Fossil SCM
Merge trunk into markdown-tagrefs branch.
Commit
7321b44acf26a4bed61b2a39a50b8e95855eeb7d0102bca66ab6a05150ff3ec7
Parent
5ade6fb863e484e…
12 files changed
+7
-3
+5
-2
+1
+17
-10
+1
-1
+5
-4
+8
-1
+17
-5
+104
-8
+1
-1
+8
-1
+1
-1
+7
-3
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -845,17 +845,17 @@ | ||
| 845 | 845 | @ <h2>%s(zObjType) in the %z(href("%R/info?name=tip"))latest check-in</a> |
| 846 | 846 | }else if( isBranchCI ){ |
| 847 | 847 | @ <h2>%s(zObjType) in the %z(href("%R/info?name=%T",zCI))latest check-in\ |
| 848 | 848 | @ </a> for branch %z(href("%R/timeline?r=%T",zCI))%h(zCI)</a> |
| 849 | 849 | if( blob_size(&dirname) ){ |
| 850 | - @ and %s(blob_str(&dirname))</h2> | |
| 850 | + @ and %s(blob_str(&dirname)) | |
| 851 | 851 | } |
| 852 | 852 | }else if( zCI ){ |
| 853 | 853 | @ <h2>%s(zObjType) for check-in \ |
| 854 | - @ %z(href("%R/info?name=%T",zCI))%h(zCI)</a></h2> | |
| 854 | + @ %z(href("%R/info?name=%T",zCI))%h(zCI)</a> | |
| 855 | 855 | if( blob_size(&dirname) ){ |
| 856 | - @ and %s(blob_str(&dirname))</h2> | |
| 856 | + @ and %s(blob_str(&dirname)) | |
| 857 | 857 | } |
| 858 | 858 | }else{ |
| 859 | 859 | int n = db_int(0, "SELECT count(*) FROM plink"); |
| 860 | 860 | @ <h2>%s(zObjType) from all %d(n) check-ins %s(blob_str(&dirname)) |
| 861 | 861 | } |
| @@ -863,10 +863,14 @@ | ||
| 863 | 863 | @ sorted by modification time</h2> |
| 864 | 864 | }else{ |
| 865 | 865 | @ sorted by filename</h2> |
| 866 | 866 | } |
| 867 | 867 | |
| 868 | + if( zNow ){ | |
| 869 | + @ <p>File ages are expressed relative to the check-in time of | |
| 870 | + @ %z(href("%R/timeline?c=%t",zNow))%s(zNow)</a>.</p> | |
| 871 | + } | |
| 868 | 872 | |
| 869 | 873 | /* Generate tree of lists. |
| 870 | 874 | ** |
| 871 | 875 | ** Each file and directory is a list element: <li>. Files have class=file |
| 872 | 876 | ** and if the filename as the suffix "xyz" the file also has class=file-xyz. |
| 873 | 877 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -845,17 +845,17 @@ | |
| 845 | @ <h2>%s(zObjType) in the %z(href("%R/info?name=tip"))latest check-in</a> |
| 846 | }else if( isBranchCI ){ |
| 847 | @ <h2>%s(zObjType) in the %z(href("%R/info?name=%T",zCI))latest check-in\ |
| 848 | @ </a> for branch %z(href("%R/timeline?r=%T",zCI))%h(zCI)</a> |
| 849 | if( blob_size(&dirname) ){ |
| 850 | @ and %s(blob_str(&dirname))</h2> |
| 851 | } |
| 852 | }else if( zCI ){ |
| 853 | @ <h2>%s(zObjType) for check-in \ |
| 854 | @ %z(href("%R/info?name=%T",zCI))%h(zCI)</a></h2> |
| 855 | if( blob_size(&dirname) ){ |
| 856 | @ and %s(blob_str(&dirname))</h2> |
| 857 | } |
| 858 | }else{ |
| 859 | int n = db_int(0, "SELECT count(*) FROM plink"); |
| 860 | @ <h2>%s(zObjType) from all %d(n) check-ins %s(blob_str(&dirname)) |
| 861 | } |
| @@ -863,10 +863,14 @@ | |
| 863 | @ sorted by modification time</h2> |
| 864 | }else{ |
| 865 | @ sorted by filename</h2> |
| 866 | } |
| 867 | |
| 868 | |
| 869 | /* Generate tree of lists. |
| 870 | ** |
| 871 | ** Each file and directory is a list element: <li>. Files have class=file |
| 872 | ** and if the filename as the suffix "xyz" the file also has class=file-xyz. |
| 873 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -845,17 +845,17 @@ | |
| 845 | @ <h2>%s(zObjType) in the %z(href("%R/info?name=tip"))latest check-in</a> |
| 846 | }else if( isBranchCI ){ |
| 847 | @ <h2>%s(zObjType) in the %z(href("%R/info?name=%T",zCI))latest check-in\ |
| 848 | @ </a> for branch %z(href("%R/timeline?r=%T",zCI))%h(zCI)</a> |
| 849 | if( blob_size(&dirname) ){ |
| 850 | @ and %s(blob_str(&dirname)) |
| 851 | } |
| 852 | }else if( zCI ){ |
| 853 | @ <h2>%s(zObjType) for check-in \ |
| 854 | @ %z(href("%R/info?name=%T",zCI))%h(zCI)</a> |
| 855 | if( blob_size(&dirname) ){ |
| 856 | @ and %s(blob_str(&dirname)) |
| 857 | } |
| 858 | }else{ |
| 859 | int n = db_int(0, "SELECT count(*) FROM plink"); |
| 860 | @ <h2>%s(zObjType) from all %d(n) check-ins %s(blob_str(&dirname)) |
| 861 | } |
| @@ -863,10 +863,14 @@ | |
| 863 | @ sorted by modification time</h2> |
| 864 | }else{ |
| 865 | @ sorted by filename</h2> |
| 866 | } |
| 867 | |
| 868 | if( zNow ){ |
| 869 | @ <p>File ages are expressed relative to the check-in time of |
| 870 | @ %z(href("%R/timeline?c=%t",zNow))%s(zNow)</a>.</p> |
| 871 | } |
| 872 | |
| 873 | /* Generate tree of lists. |
| 874 | ** |
| 875 | ** Each file and directory is a list element: <li>. Files have class=file |
| 876 | ** and if the filename as the suffix "xyz" the file also has class=file-xyz. |
| 877 |
+5
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -97,13 +97,16 @@ | ||
| 97 | 97 | }else if( isDir==0 ){ |
| 98 | 98 | fossil_warning("not found: %s", &zName[nRoot]); |
| 99 | 99 | }else if( file_access(zName, R_OK) ){ |
| 100 | 100 | fossil_fatal("cannot open %s", &zName[nRoot]); |
| 101 | 101 | }else{ |
| 102 | + /* Only add unmanaged file paths specified on the command line. */ | |
| 102 | 103 | db_multi_exec( |
| 103 | - "INSERT OR IGNORE INTO sfile(pathname) VALUES(%Q)", | |
| 104 | - &zName[nRoot] | |
| 104 | + "INSERT OR IGNORE INTO sfile(pathname)" | |
| 105 | + " SELECT %Q WHERE NOT EXISTS" | |
| 106 | + " (SELECT 1 FROM vfile WHERE pathname=%Q)", | |
| 107 | + &zName[nRoot], &zName[nRoot] | |
| 105 | 108 | ); |
| 106 | 109 | } |
| 107 | 110 | blob_reset(&name); |
| 108 | 111 | } |
| 109 | 112 | } |
| 110 | 113 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -97,13 +97,16 @@ | |
| 97 | }else if( isDir==0 ){ |
| 98 | fossil_warning("not found: %s", &zName[nRoot]); |
| 99 | }else if( file_access(zName, R_OK) ){ |
| 100 | fossil_fatal("cannot open %s", &zName[nRoot]); |
| 101 | }else{ |
| 102 | db_multi_exec( |
| 103 | "INSERT OR IGNORE INTO sfile(pathname) VALUES(%Q)", |
| 104 | &zName[nRoot] |
| 105 | ); |
| 106 | } |
| 107 | blob_reset(&name); |
| 108 | } |
| 109 | } |
| 110 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -97,13 +97,16 @@ | |
| 97 | }else if( isDir==0 ){ |
| 98 | fossil_warning("not found: %s", &zName[nRoot]); |
| 99 | }else if( file_access(zName, R_OK) ){ |
| 100 | fossil_fatal("cannot open %s", &zName[nRoot]); |
| 101 | }else{ |
| 102 | /* Only add unmanaged file paths specified on the command line. */ |
| 103 | db_multi_exec( |
| 104 | "INSERT OR IGNORE INTO sfile(pathname)" |
| 105 | " SELECT %Q WHERE NOT EXISTS" |
| 106 | " (SELECT 1 FROM vfile WHERE pathname=%Q)", |
| 107 | &zName[nRoot], &zName[nRoot] |
| 108 | ); |
| 109 | } |
| 110 | blob_reset(&name); |
| 111 | } |
| 112 | } |
| 113 |
+1
| --- src/default.css | ||
| +++ src/default.css | ||
| @@ -580,10 +580,11 @@ | ||
| 580 | 580 | table.diff td.difftxt > pre { |
| 581 | 581 | min-width: 100%; |
| 582 | 582 | max-width: 100%; |
| 583 | 583 | } |
| 584 | 584 | table.diff td > pre { |
| 585 | + box-sizing: border-box; | |
| 585 | 586 | /* Workaround for "slight wiggle" when using mouse-wheel in some FF |
| 586 | 587 | versions, apparently caused by the increased line-height forcing |
| 587 | 588 | these elements to be a *tick* larger than they should be but not |
| 588 | 589 | large enough to force a scroll bar to show up. */ |
| 589 | 590 | overflow-y: hidden; |
| 590 | 591 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -580,10 +580,11 @@ | |
| 580 | table.diff td.difftxt > pre { |
| 581 | min-width: 100%; |
| 582 | max-width: 100%; |
| 583 | } |
| 584 | table.diff td > pre { |
| 585 | /* Workaround for "slight wiggle" when using mouse-wheel in some FF |
| 586 | versions, apparently caused by the increased line-height forcing |
| 587 | these elements to be a *tick* larger than they should be but not |
| 588 | large enough to force a scroll bar to show up. */ |
| 589 | overflow-y: hidden; |
| 590 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -580,10 +580,11 @@ | |
| 580 | table.diff td.difftxt > pre { |
| 581 | min-width: 100%; |
| 582 | max-width: 100%; |
| 583 | } |
| 584 | table.diff td > pre { |
| 585 | box-sizing: border-box; |
| 586 | /* Workaround for "slight wiggle" when using mouse-wheel in some FF |
| 587 | versions, apparently caused by the increased line-height forcing |
| 588 | these elements to be a *tick* larger than they should be but not |
| 589 | large enough to force a scroll bar to show up. */ |
| 590 | overflow-y: hidden; |
| 591 |
+17
-10
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -31,12 +31,15 @@ | ||
| 31 | 31 | ** For the -l|--log mode: If "-b|--brief" is specified one line per revision |
| 32 | 32 | ** is printed, otherwise the full comment is printed. The "-n|--limit N" |
| 33 | 33 | ** and "--offset P" options limits the output to the first N changes |
| 34 | 34 | ** after skipping P changes. |
| 35 | 35 | ** |
| 36 | -** The -i mode will print the artifact ID of FILENAME given the REVISION | |
| 37 | -** provided by the -r flag (which is required). | |
| 36 | +** The -i mode will print various facts about FILENAME, including its | |
| 37 | +** hash and the check-in and time when the current version of the file | |
| 38 | +** was created. Use -v for additional information. Add the -r VERSION | |
| 39 | +** option to see similar information about the same file for the check-in | |
| 40 | +** specified by VERSION. | |
| 38 | 41 | ** |
| 39 | 42 | ** In the -s mode prints the status as <status> <revision>. This is |
| 40 | 43 | ** a quick status and does not check for up-to-date-ness of the file. |
| 41 | 44 | ** |
| 42 | 45 | ** In the -p mode, there's an optional flag "-r|--revision REVISION". |
| @@ -44,22 +47,24 @@ | ||
| 44 | 47 | ** to stdout. The -p mode is another form of the "cat" command. |
| 45 | 48 | ** |
| 46 | 49 | ** Options: |
| 47 | 50 | ** -b|--brief Display a brief (one line / revision) summary |
| 48 | 51 | ** --case-sensitive B Enable or disable case-sensitive filenames. B is a |
| 49 | -** boolean: "yes", "no", "true", "false", etc. | |
| 50 | -** -i|--id Print the artifact ID (requires -r) | |
| 52 | +** boolean: "yes", "no", "true", "false", etc. | |
| 53 | +** -i|--id Print the artifact ID | |
| 51 | 54 | ** -l|--log Select log mode (the default) |
| 52 | 55 | ** -n|--limit N Display the first N changes (default unlimited). |
| 53 | -** N less than 0 means no limit. | |
| 56 | +** N less than 0 means no limit. | |
| 54 | 57 | ** --offset P Skip P changes |
| 55 | 58 | ** -p|--print Select print mode |
| 56 | 59 | ** -r|--revision R Print the given revision (or ckout, if none is given) |
| 57 | -** to stdout (only in print mode) | |
| 60 | +** to stdout (only in print mode) | |
| 58 | 61 | ** -s|--status Select status mode (print a status indicator for FILE) |
| 62 | +** -v|--verbose On the -i option, show all check-ins that use the | |
| 63 | +** file, not just the earliest check-in | |
| 59 | 64 | ** -W|--width N Width of lines (default is to auto-detect). Must be |
| 60 | -** more than 22 or else 0 to indicate no limit. | |
| 65 | +** more than 22 or else 0 to indicate no limit. | |
| 61 | 66 | ** |
| 62 | 67 | ** See also: [[artifact]], [[cat]], [[descendants]], [[info]], [[leaves]] |
| 63 | 68 | */ |
| 64 | 69 | void finfo_cmd(void){ |
| 65 | 70 | db_must_be_within_tree(); |
| @@ -142,26 +147,28 @@ | ||
| 142 | 147 | blob_reset(&record); |
| 143 | 148 | blob_reset(&fname); |
| 144 | 149 | }else if( find_option("id","i",0) ){ |
| 145 | 150 | Blob fname; |
| 146 | 151 | int rid; |
| 152 | + int whatisFlags = WHATIS_BRIEF; | |
| 147 | 153 | const char *zRevision = find_option("revision", "r", 1); |
| 154 | + if( find_option("verbose","v",0)!=0 ) whatisFlags = 0; | |
| 148 | 155 | |
| 149 | 156 | verify_all_options(); |
| 150 | 157 | |
| 151 | - if( zRevision==0 ) usage("-i|--id also requires -r|--revision"); | |
| 152 | - if( g.argc!=3 ) usage("-r|--revision REVISION FILENAME"); | |
| 158 | + if( zRevision==0 ) zRevision = "current"; | |
| 159 | + if( g.argc!=3 ) usage("FILENAME"); | |
| 153 | 160 | file_tree_name(g.argv[2], &fname, 0, 1); |
| 154 | 161 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid =" |
| 155 | 162 | " (SELECT uuid FROM files_of_checkin(%Q)" |
| 156 | 163 | " WHERE filename=%B %s)", |
| 157 | 164 | zRevision, &fname, filename_collation()); |
| 158 | 165 | if( rid==0 ) { |
| 159 | 166 | fossil_fatal("file not found for revision %s: %s", |
| 160 | 167 | zRevision, blob_str(&fname)); |
| 161 | 168 | } |
| 162 | - whatis_rid(rid,0); | |
| 169 | + whatis_rid(rid,whatisFlags); | |
| 163 | 170 | blob_reset(&fname); |
| 164 | 171 | }else{ |
| 165 | 172 | Blob line; |
| 166 | 173 | Stmt q; |
| 167 | 174 | Blob fname; |
| 168 | 175 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -31,12 +31,15 @@ | |
| 31 | ** For the -l|--log mode: If "-b|--brief" is specified one line per revision |
| 32 | ** is printed, otherwise the full comment is printed. The "-n|--limit N" |
| 33 | ** and "--offset P" options limits the output to the first N changes |
| 34 | ** after skipping P changes. |
| 35 | ** |
| 36 | ** The -i mode will print the artifact ID of FILENAME given the REVISION |
| 37 | ** provided by the -r flag (which is required). |
| 38 | ** |
| 39 | ** In the -s mode prints the status as <status> <revision>. This is |
| 40 | ** a quick status and does not check for up-to-date-ness of the file. |
| 41 | ** |
| 42 | ** In the -p mode, there's an optional flag "-r|--revision REVISION". |
| @@ -44,22 +47,24 @@ | |
| 44 | ** to stdout. The -p mode is another form of the "cat" command. |
| 45 | ** |
| 46 | ** Options: |
| 47 | ** -b|--brief Display a brief (one line / revision) summary |
| 48 | ** --case-sensitive B Enable or disable case-sensitive filenames. B is a |
| 49 | ** boolean: "yes", "no", "true", "false", etc. |
| 50 | ** -i|--id Print the artifact ID (requires -r) |
| 51 | ** -l|--log Select log mode (the default) |
| 52 | ** -n|--limit N Display the first N changes (default unlimited). |
| 53 | ** N less than 0 means no limit. |
| 54 | ** --offset P Skip P changes |
| 55 | ** -p|--print Select print mode |
| 56 | ** -r|--revision R Print the given revision (or ckout, if none is given) |
| 57 | ** to stdout (only in print mode) |
| 58 | ** -s|--status Select status mode (print a status indicator for FILE) |
| 59 | ** -W|--width N Width of lines (default is to auto-detect). Must be |
| 60 | ** more than 22 or else 0 to indicate no limit. |
| 61 | ** |
| 62 | ** See also: [[artifact]], [[cat]], [[descendants]], [[info]], [[leaves]] |
| 63 | */ |
| 64 | void finfo_cmd(void){ |
| 65 | db_must_be_within_tree(); |
| @@ -142,26 +147,28 @@ | |
| 142 | blob_reset(&record); |
| 143 | blob_reset(&fname); |
| 144 | }else if( find_option("id","i",0) ){ |
| 145 | Blob fname; |
| 146 | int rid; |
| 147 | const char *zRevision = find_option("revision", "r", 1); |
| 148 | |
| 149 | verify_all_options(); |
| 150 | |
| 151 | if( zRevision==0 ) usage("-i|--id also requires -r|--revision"); |
| 152 | if( g.argc!=3 ) usage("-r|--revision REVISION FILENAME"); |
| 153 | file_tree_name(g.argv[2], &fname, 0, 1); |
| 154 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid =" |
| 155 | " (SELECT uuid FROM files_of_checkin(%Q)" |
| 156 | " WHERE filename=%B %s)", |
| 157 | zRevision, &fname, filename_collation()); |
| 158 | if( rid==0 ) { |
| 159 | fossil_fatal("file not found for revision %s: %s", |
| 160 | zRevision, blob_str(&fname)); |
| 161 | } |
| 162 | whatis_rid(rid,0); |
| 163 | blob_reset(&fname); |
| 164 | }else{ |
| 165 | Blob line; |
| 166 | Stmt q; |
| 167 | Blob fname; |
| 168 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -31,12 +31,15 @@ | |
| 31 | ** For the -l|--log mode: If "-b|--brief" is specified one line per revision |
| 32 | ** is printed, otherwise the full comment is printed. The "-n|--limit N" |
| 33 | ** and "--offset P" options limits the output to the first N changes |
| 34 | ** after skipping P changes. |
| 35 | ** |
| 36 | ** The -i mode will print various facts about FILENAME, including its |
| 37 | ** hash and the check-in and time when the current version of the file |
| 38 | ** was created. Use -v for additional information. Add the -r VERSION |
| 39 | ** option to see similar information about the same file for the check-in |
| 40 | ** specified by VERSION. |
| 41 | ** |
| 42 | ** In the -s mode prints the status as <status> <revision>. This is |
| 43 | ** a quick status and does not check for up-to-date-ness of the file. |
| 44 | ** |
| 45 | ** In the -p mode, there's an optional flag "-r|--revision REVISION". |
| @@ -44,22 +47,24 @@ | |
| 47 | ** to stdout. The -p mode is another form of the "cat" command. |
| 48 | ** |
| 49 | ** Options: |
| 50 | ** -b|--brief Display a brief (one line / revision) summary |
| 51 | ** --case-sensitive B Enable or disable case-sensitive filenames. B is a |
| 52 | ** boolean: "yes", "no", "true", "false", etc. |
| 53 | ** -i|--id Print the artifact ID |
| 54 | ** -l|--log Select log mode (the default) |
| 55 | ** -n|--limit N Display the first N changes (default unlimited). |
| 56 | ** N less than 0 means no limit. |
| 57 | ** --offset P Skip P changes |
| 58 | ** -p|--print Select print mode |
| 59 | ** -r|--revision R Print the given revision (or ckout, if none is given) |
| 60 | ** to stdout (only in print mode) |
| 61 | ** -s|--status Select status mode (print a status indicator for FILE) |
| 62 | ** -v|--verbose On the -i option, show all check-ins that use the |
| 63 | ** file, not just the earliest check-in |
| 64 | ** -W|--width N Width of lines (default is to auto-detect). Must be |
| 65 | ** more than 22 or else 0 to indicate no limit. |
| 66 | ** |
| 67 | ** See also: [[artifact]], [[cat]], [[descendants]], [[info]], [[leaves]] |
| 68 | */ |
| 69 | void finfo_cmd(void){ |
| 70 | db_must_be_within_tree(); |
| @@ -142,26 +147,28 @@ | |
| 147 | blob_reset(&record); |
| 148 | blob_reset(&fname); |
| 149 | }else if( find_option("id","i",0) ){ |
| 150 | Blob fname; |
| 151 | int rid; |
| 152 | int whatisFlags = WHATIS_BRIEF; |
| 153 | const char *zRevision = find_option("revision", "r", 1); |
| 154 | if( find_option("verbose","v",0)!=0 ) whatisFlags = 0; |
| 155 | |
| 156 | verify_all_options(); |
| 157 | |
| 158 | if( zRevision==0 ) zRevision = "current"; |
| 159 | if( g.argc!=3 ) usage("FILENAME"); |
| 160 | file_tree_name(g.argv[2], &fname, 0, 1); |
| 161 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid =" |
| 162 | " (SELECT uuid FROM files_of_checkin(%Q)" |
| 163 | " WHERE filename=%B %s)", |
| 164 | zRevision, &fname, filename_collation()); |
| 165 | if( rid==0 ) { |
| 166 | fossil_fatal("file not found for revision %s: %s", |
| 167 | zRevision, blob_str(&fname)); |
| 168 | } |
| 169 | whatis_rid(rid,whatisFlags); |
| 170 | blob_reset(&fname); |
| 171 | }else{ |
| 172 | Blob line; |
| 173 | Stmt q; |
| 174 | Blob fname; |
| 175 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2453,11 +2453,11 @@ | ||
| 2453 | 2453 | url_add_parameter(&url, "name", zName); |
| 2454 | 2454 | url_add_parameter(&url, "ci", zCI); /* no-op if zCI is NULL */ |
| 2455 | 2455 | |
| 2456 | 2456 | if( zCI==0 && !isFile ){ |
| 2457 | 2457 | /* If there is no ci= query parameter, then prefer to interpret |
| 2458 | - ** name= as a hash for /artifact and /whatis. But for not for /file. | |
| 2458 | + ** name= as a hash for /artifact and /whatis. But not for /file. | |
| 2459 | 2459 | ** For /file, a name= without a ci= will prefer to use the default |
| 2460 | 2460 | ** "tip" value for ci=. */ |
| 2461 | 2461 | rid = name_to_rid(zName); |
| 2462 | 2462 | } |
| 2463 | 2463 | if( rid==0 ){ |
| 2464 | 2464 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2453,11 +2453,11 @@ | |
| 2453 | url_add_parameter(&url, "name", zName); |
| 2454 | url_add_parameter(&url, "ci", zCI); /* no-op if zCI is NULL */ |
| 2455 | |
| 2456 | if( zCI==0 && !isFile ){ |
| 2457 | /* If there is no ci= query parameter, then prefer to interpret |
| 2458 | ** name= as a hash for /artifact and /whatis. But for not for /file. |
| 2459 | ** For /file, a name= without a ci= will prefer to use the default |
| 2460 | ** "tip" value for ci=. */ |
| 2461 | rid = name_to_rid(zName); |
| 2462 | } |
| 2463 | if( rid==0 ){ |
| 2464 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2453,11 +2453,11 @@ | |
| 2453 | url_add_parameter(&url, "name", zName); |
| 2454 | url_add_parameter(&url, "ci", zCI); /* no-op if zCI is NULL */ |
| 2455 | |
| 2456 | if( zCI==0 && !isFile ){ |
| 2457 | /* If there is no ci= query parameter, then prefer to interpret |
| 2458 | ** name= as a hash for /artifact and /whatis. But not for /file. |
| 2459 | ** For /file, a name= without a ci= will prefer to use the default |
| 2460 | ** "tip" value for ci=. */ |
| 2461 | rid = name_to_rid(zName); |
| 2462 | } |
| 2463 | if( rid==0 ){ |
| 2464 |
+5
-4
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -3048,19 +3048,19 @@ | ||
| 3048 | 3048 | ** result in fewer HTTP requests than the separate mode. |
| 3049 | 3049 | ** --mainmenu FILE Override the mainmenu config setting with the contents |
| 3050 | 3050 | ** of the given file. |
| 3051 | 3051 | ** --max-latency N Do not let any single HTTP request run for more than N |
| 3052 | 3052 | ** seconds (only works on unix) |
| 3053 | -** --nobrowser Do not automatically launch a web-browser for the | |
| 3053 | +** -B|--nobrowser Do not automatically launch a web-browser for the | |
| 3054 | 3054 | ** "fossil ui" command. |
| 3055 | 3055 | ** --nocompress Do not compress HTTP replies |
| 3056 | 3056 | ** --nojail Drop root privileges but do not enter the chroot jail |
| 3057 | 3057 | ** --nossl do not force redirects to SSL even if the repository |
| 3058 | 3058 | ** setting "redirect-to-https" requests it. This is set |
| 3059 | 3059 | ** by default for the "ui" command. |
| 3060 | 3060 | ** --notfound URL Redirect to URL if a page is not found. |
| 3061 | -** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci" | |
| 3061 | +** -p|--page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci" | |
| 3062 | 3062 | ** --pkey FILE Read the private key used for TLS from FILE. |
| 3063 | 3063 | ** -P|--port TCPPORT listen to request on port TCPPORT |
| 3064 | 3064 | ** --repolist If REPOSITORY is dir, URL "/" lists repos. |
| 3065 | 3065 | ** --scgi Accept SCGI rather than HTTP |
| 3066 | 3066 | ** --skin LABEL Use override skin LABEL |
| @@ -3124,11 +3124,11 @@ | ||
| 3124 | 3124 | g.useLocalauth = find_option("localauth", 0, 0)!=0; |
| 3125 | 3125 | Th_InitTraceLog(); |
| 3126 | 3126 | zPort = find_option("port", "P", 1); |
| 3127 | 3127 | isUiCmd = g.argv[1][0]=='u'; |
| 3128 | 3128 | if( isUiCmd ){ |
| 3129 | - zInitPage = find_option("page", 0, 1); | |
| 3129 | + zInitPage = find_option("page", "p", 1); | |
| 3130 | 3130 | if( zInitPage && zInitPage[0]=='/' ) zInitPage++; |
| 3131 | 3131 | zFossilCmd = find_option("fossilcmd", 0, 1); |
| 3132 | 3132 | } |
| 3133 | 3133 | zNotFound = find_option("notfound", 0, 1); |
| 3134 | 3134 | allowRepoList = find_option("repolist",0,0)!=0; |
| @@ -3138,11 +3138,11 @@ | ||
| 3138 | 3138 | if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI; |
| 3139 | 3139 | if( zAltBase ){ |
| 3140 | 3140 | set_base_url(zAltBase); |
| 3141 | 3141 | } |
| 3142 | 3142 | g.sslNotAvailable = find_option("nossl", 0, 0)!=0 || isUiCmd; |
| 3143 | - fNoBrowser = find_option("nobrowser", 0, 0)!=0; | |
| 3143 | + fNoBrowser = find_option("nobrowser", "B", 0)!=0; | |
| 3144 | 3144 | decode_ssl_options(); |
| 3145 | 3145 | if( find_option("https",0,0)!=0 || g.httpUseSSL ){ |
| 3146 | 3146 | cgi_replace_parameter("HTTPS","on"); |
| 3147 | 3147 | } |
| 3148 | 3148 | if( find_option("localhost", 0, 0)!=0 ){ |
| @@ -3230,10 +3230,11 @@ | ||
| 3230 | 3230 | } |
| 3231 | 3231 | zPort += i+1; |
| 3232 | 3232 | } |
| 3233 | 3233 | } |
| 3234 | 3234 | iPort = mxPort = atoi(zPort); |
| 3235 | + if( iPort<=0 ) fossil_fatal("port number must be greater than zero"); | |
| 3235 | 3236 | }else{ |
| 3236 | 3237 | iPort = db_get_int("http-port", 8080); |
| 3237 | 3238 | mxPort = iPort+100; |
| 3238 | 3239 | } |
| 3239 | 3240 | if( isUiCmd && !fNoBrowser ){ |
| 3240 | 3241 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -3048,19 +3048,19 @@ | |
| 3048 | ** result in fewer HTTP requests than the separate mode. |
| 3049 | ** --mainmenu FILE Override the mainmenu config setting with the contents |
| 3050 | ** of the given file. |
| 3051 | ** --max-latency N Do not let any single HTTP request run for more than N |
| 3052 | ** seconds (only works on unix) |
| 3053 | ** --nobrowser Do not automatically launch a web-browser for the |
| 3054 | ** "fossil ui" command. |
| 3055 | ** --nocompress Do not compress HTTP replies |
| 3056 | ** --nojail Drop root privileges but do not enter the chroot jail |
| 3057 | ** --nossl do not force redirects to SSL even if the repository |
| 3058 | ** setting "redirect-to-https" requests it. This is set |
| 3059 | ** by default for the "ui" command. |
| 3060 | ** --notfound URL Redirect to URL if a page is not found. |
| 3061 | ** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci" |
| 3062 | ** --pkey FILE Read the private key used for TLS from FILE. |
| 3063 | ** -P|--port TCPPORT listen to request on port TCPPORT |
| 3064 | ** --repolist If REPOSITORY is dir, URL "/" lists repos. |
| 3065 | ** --scgi Accept SCGI rather than HTTP |
| 3066 | ** --skin LABEL Use override skin LABEL |
| @@ -3124,11 +3124,11 @@ | |
| 3124 | g.useLocalauth = find_option("localauth", 0, 0)!=0; |
| 3125 | Th_InitTraceLog(); |
| 3126 | zPort = find_option("port", "P", 1); |
| 3127 | isUiCmd = g.argv[1][0]=='u'; |
| 3128 | if( isUiCmd ){ |
| 3129 | zInitPage = find_option("page", 0, 1); |
| 3130 | if( zInitPage && zInitPage[0]=='/' ) zInitPage++; |
| 3131 | zFossilCmd = find_option("fossilcmd", 0, 1); |
| 3132 | } |
| 3133 | zNotFound = find_option("notfound", 0, 1); |
| 3134 | allowRepoList = find_option("repolist",0,0)!=0; |
| @@ -3138,11 +3138,11 @@ | |
| 3138 | if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI; |
| 3139 | if( zAltBase ){ |
| 3140 | set_base_url(zAltBase); |
| 3141 | } |
| 3142 | g.sslNotAvailable = find_option("nossl", 0, 0)!=0 || isUiCmd; |
| 3143 | fNoBrowser = find_option("nobrowser", 0, 0)!=0; |
| 3144 | decode_ssl_options(); |
| 3145 | if( find_option("https",0,0)!=0 || g.httpUseSSL ){ |
| 3146 | cgi_replace_parameter("HTTPS","on"); |
| 3147 | } |
| 3148 | if( find_option("localhost", 0, 0)!=0 ){ |
| @@ -3230,10 +3230,11 @@ | |
| 3230 | } |
| 3231 | zPort += i+1; |
| 3232 | } |
| 3233 | } |
| 3234 | iPort = mxPort = atoi(zPort); |
| 3235 | }else{ |
| 3236 | iPort = db_get_int("http-port", 8080); |
| 3237 | mxPort = iPort+100; |
| 3238 | } |
| 3239 | if( isUiCmd && !fNoBrowser ){ |
| 3240 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -3048,19 +3048,19 @@ | |
| 3048 | ** result in fewer HTTP requests than the separate mode. |
| 3049 | ** --mainmenu FILE Override the mainmenu config setting with the contents |
| 3050 | ** of the given file. |
| 3051 | ** --max-latency N Do not let any single HTTP request run for more than N |
| 3052 | ** seconds (only works on unix) |
| 3053 | ** -B|--nobrowser Do not automatically launch a web-browser for the |
| 3054 | ** "fossil ui" command. |
| 3055 | ** --nocompress Do not compress HTTP replies |
| 3056 | ** --nojail Drop root privileges but do not enter the chroot jail |
| 3057 | ** --nossl do not force redirects to SSL even if the repository |
| 3058 | ** setting "redirect-to-https" requests it. This is set |
| 3059 | ** by default for the "ui" command. |
| 3060 | ** --notfound URL Redirect to URL if a page is not found. |
| 3061 | ** -p|--page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci" |
| 3062 | ** --pkey FILE Read the private key used for TLS from FILE. |
| 3063 | ** -P|--port TCPPORT listen to request on port TCPPORT |
| 3064 | ** --repolist If REPOSITORY is dir, URL "/" lists repos. |
| 3065 | ** --scgi Accept SCGI rather than HTTP |
| 3066 | ** --skin LABEL Use override skin LABEL |
| @@ -3124,11 +3124,11 @@ | |
| 3124 | g.useLocalauth = find_option("localauth", 0, 0)!=0; |
| 3125 | Th_InitTraceLog(); |
| 3126 | zPort = find_option("port", "P", 1); |
| 3127 | isUiCmd = g.argv[1][0]=='u'; |
| 3128 | if( isUiCmd ){ |
| 3129 | zInitPage = find_option("page", "p", 1); |
| 3130 | if( zInitPage && zInitPage[0]=='/' ) zInitPage++; |
| 3131 | zFossilCmd = find_option("fossilcmd", 0, 1); |
| 3132 | } |
| 3133 | zNotFound = find_option("notfound", 0, 1); |
| 3134 | allowRepoList = find_option("repolist",0,0)!=0; |
| @@ -3138,11 +3138,11 @@ | |
| 3138 | if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI; |
| 3139 | if( zAltBase ){ |
| 3140 | set_base_url(zAltBase); |
| 3141 | } |
| 3142 | g.sslNotAvailable = find_option("nossl", 0, 0)!=0 || isUiCmd; |
| 3143 | fNoBrowser = find_option("nobrowser", "B", 0)!=0; |
| 3144 | decode_ssl_options(); |
| 3145 | if( find_option("https",0,0)!=0 || g.httpUseSSL ){ |
| 3146 | cgi_replace_parameter("HTTPS","on"); |
| 3147 | } |
| 3148 | if( find_option("localhost", 0, 0)!=0 ){ |
| @@ -3230,10 +3230,11 @@ | |
| 3230 | } |
| 3231 | zPort += i+1; |
| 3232 | } |
| 3233 | } |
| 3234 | iPort = mxPort = atoi(zPort); |
| 3235 | if( iPort<=0 ) fossil_fatal("port number must be greater than zero"); |
| 3236 | }else{ |
| 3237 | iPort = db_get_int("http-port", 8080); |
| 3238 | mxPort = iPort+100; |
| 3239 | } |
| 3240 | if( isUiCmd && !fNoBrowser ){ |
| 3241 |
+8
-1
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -1014,11 +1014,18 @@ | ||
| 1014 | 1014 | ); |
| 1015 | 1015 | zName = db_column_text(&q, 1); |
| 1016 | 1016 | zFullName = mprintf("%s%s", g.zLocalRoot, zName); |
| 1017 | 1017 | if( file_isfile_or_link(zFullName) |
| 1018 | 1018 | && !db_exists("SELECT 1 FROM fv WHERE fn=%Q", zName) ){ |
| 1019 | - fossil_print("ADDED %s (overwrites an unmanaged file)\n", zName); | |
| 1019 | + /* Name of backup file with Original content */ | |
| 1020 | + char *zOrig = file_newname(zFullName, "original", 1); | |
| 1021 | + /* Backup previously unanaged file before to be overwritten */ | |
| 1022 | + file_copy(zFullName, zOrig); | |
| 1023 | + fossil_free(zOrig); | |
| 1024 | + fossil_print("ADDED %s (overwrites an unmanaged file)", zName); | |
| 1025 | + if( !dryRunFlag ) fossil_print(", original copy backed up locally"); | |
| 1026 | + fossil_print("\n"); | |
| 1020 | 1027 | nOverwrite++; |
| 1021 | 1028 | }else{ |
| 1022 | 1029 | fossil_print("ADDED %s\n", zName); |
| 1023 | 1030 | } |
| 1024 | 1031 | fossil_free(zFullName); |
| 1025 | 1032 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -1014,11 +1014,18 @@ | |
| 1014 | ); |
| 1015 | zName = db_column_text(&q, 1); |
| 1016 | zFullName = mprintf("%s%s", g.zLocalRoot, zName); |
| 1017 | if( file_isfile_or_link(zFullName) |
| 1018 | && !db_exists("SELECT 1 FROM fv WHERE fn=%Q", zName) ){ |
| 1019 | fossil_print("ADDED %s (overwrites an unmanaged file)\n", zName); |
| 1020 | nOverwrite++; |
| 1021 | }else{ |
| 1022 | fossil_print("ADDED %s\n", zName); |
| 1023 | } |
| 1024 | fossil_free(zFullName); |
| 1025 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -1014,11 +1014,18 @@ | |
| 1014 | ); |
| 1015 | zName = db_column_text(&q, 1); |
| 1016 | zFullName = mprintf("%s%s", g.zLocalRoot, zName); |
| 1017 | if( file_isfile_or_link(zFullName) |
| 1018 | && !db_exists("SELECT 1 FROM fv WHERE fn=%Q", zName) ){ |
| 1019 | /* Name of backup file with Original content */ |
| 1020 | char *zOrig = file_newname(zFullName, "original", 1); |
| 1021 | /* Backup previously unanaged file before to be overwritten */ |
| 1022 | file_copy(zFullName, zOrig); |
| 1023 | fossil_free(zOrig); |
| 1024 | fossil_print("ADDED %s (overwrites an unmanaged file)", zName); |
| 1025 | if( !dryRunFlag ) fossil_print(", original copy backed up locally"); |
| 1026 | fossil_print("\n"); |
| 1027 | nOverwrite++; |
| 1028 | }else{ |
| 1029 | fossil_print("ADDED %s\n", zName); |
| 1030 | } |
| 1031 | fossil_free(zFullName); |
| 1032 |
+17
-5
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -844,14 +844,22 @@ | ||
| 844 | 844 | default: break; |
| 845 | 845 | } |
| 846 | 846 | return zType; |
| 847 | 847 | } |
| 848 | 848 | |
| 849 | +/* | |
| 850 | +** Flag values for whatis_rid(). | |
| 851 | +*/ | |
| 852 | +#if INTERFACE | |
| 853 | +#define WHATIS_VERBOSE 0x01 /* Extra output */ | |
| 854 | +#define WHATIS_BRIEF 0x02 /* Omit unnecessary output */ | |
| 855 | +#endif | |
| 856 | + | |
| 849 | 857 | /* |
| 850 | 858 | ** Generate a description of artifact "rid" |
| 851 | 859 | */ |
| 852 | -void whatis_rid(int rid, int verboseFlag){ | |
| 860 | +void whatis_rid(int rid, int flags){ | |
| 853 | 861 | Stmt q; |
| 854 | 862 | int cnt; |
| 855 | 863 | |
| 856 | 864 | /* Basic information about the object. */ |
| 857 | 865 | db_prepare(&q, |
| @@ -859,11 +867,11 @@ | ||
| 859 | 867 | " FROM blob, rcvfrom" |
| 860 | 868 | " WHERE rid=%d" |
| 861 | 869 | " AND rcvfrom.rcvid=blob.rcvid", |
| 862 | 870 | rid); |
| 863 | 871 | if( db_step(&q)==SQLITE_ROW ){ |
| 864 | - if( verboseFlag ){ | |
| 872 | + if( flags & WHATIS_VERBOSE ){ | |
| 865 | 873 | fossil_print("artifact: %s (%d)\n", db_column_text(&q,0), rid); |
| 866 | 874 | fossil_print("size: %d bytes\n", db_column_int(&q,1)); |
| 867 | 875 | fossil_print("received: %s from %s\n", |
| 868 | 876 | db_column_text(&q, 2), |
| 869 | 877 | db_column_text(&q, 3)); |
| @@ -940,13 +948,17 @@ | ||
| 940 | 948 | " FROM mlink, filename, blob, event" |
| 941 | 949 | " WHERE mlink.fid=%d" |
| 942 | 950 | " AND filename.fnid=mlink.fnid" |
| 943 | 951 | " AND event.objid=mlink.mid" |
| 944 | 952 | " AND blob.rid=mlink.mid" |
| 945 | - " ORDER BY event.mtime DESC /*sort*/", | |
| 946 | - rid); | |
| 953 | + " ORDER BY event.mtime %s /*sort*/", | |
| 954 | + rid, | |
| 955 | + (flags & WHATIS_BRIEF) ? "LIMIT 1" : "DESC"); | |
| 947 | 956 | while( db_step(&q)==SQLITE_ROW ){ |
| 957 | + if( flags & WHATIS_BRIEF ){ | |
| 958 | + fossil_print("mtime: %s\n", db_column_text(&q,2)); | |
| 959 | + } | |
| 948 | 960 | fossil_print("file: %s\n", db_column_text(&q,0)); |
| 949 | 961 | fossil_print(" part of [%S] by %s on %s\n", |
| 950 | 962 | db_column_text(&q, 1), |
| 951 | 963 | db_column_text(&q, 3), |
| 952 | 964 | db_column_text(&q, 2)); |
| @@ -975,11 +987,11 @@ | ||
| 975 | 987 | ); |
| 976 | 988 | while( db_step(&q)==SQLITE_ROW ){ |
| 977 | 989 | fossil_print("attachment: %s\n", db_column_text(&q,0)); |
| 978 | 990 | fossil_print(" attached to %s %s\n", |
| 979 | 991 | db_column_text(&q,5), db_column_text(&q,4)); |
| 980 | - if( verboseFlag ){ | |
| 992 | + if( flags & WHATIS_VERBOSE ){ | |
| 981 | 993 | fossil_print(" via %s (%d)\n", |
| 982 | 994 | db_column_text(&q,7), db_column_int(&q,6)); |
| 983 | 995 | }else{ |
| 984 | 996 | fossil_print(" via %s\n", |
| 985 | 997 | db_column_text(&q,7)); |
| 986 | 998 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -844,14 +844,22 @@ | |
| 844 | default: break; |
| 845 | } |
| 846 | return zType; |
| 847 | } |
| 848 | |
| 849 | /* |
| 850 | ** Generate a description of artifact "rid" |
| 851 | */ |
| 852 | void whatis_rid(int rid, int verboseFlag){ |
| 853 | Stmt q; |
| 854 | int cnt; |
| 855 | |
| 856 | /* Basic information about the object. */ |
| 857 | db_prepare(&q, |
| @@ -859,11 +867,11 @@ | |
| 859 | " FROM blob, rcvfrom" |
| 860 | " WHERE rid=%d" |
| 861 | " AND rcvfrom.rcvid=blob.rcvid", |
| 862 | rid); |
| 863 | if( db_step(&q)==SQLITE_ROW ){ |
| 864 | if( verboseFlag ){ |
| 865 | fossil_print("artifact: %s (%d)\n", db_column_text(&q,0), rid); |
| 866 | fossil_print("size: %d bytes\n", db_column_int(&q,1)); |
| 867 | fossil_print("received: %s from %s\n", |
| 868 | db_column_text(&q, 2), |
| 869 | db_column_text(&q, 3)); |
| @@ -940,13 +948,17 @@ | |
| 940 | " FROM mlink, filename, blob, event" |
| 941 | " WHERE mlink.fid=%d" |
| 942 | " AND filename.fnid=mlink.fnid" |
| 943 | " AND event.objid=mlink.mid" |
| 944 | " AND blob.rid=mlink.mid" |
| 945 | " ORDER BY event.mtime DESC /*sort*/", |
| 946 | rid); |
| 947 | while( db_step(&q)==SQLITE_ROW ){ |
| 948 | fossil_print("file: %s\n", db_column_text(&q,0)); |
| 949 | fossil_print(" part of [%S] by %s on %s\n", |
| 950 | db_column_text(&q, 1), |
| 951 | db_column_text(&q, 3), |
| 952 | db_column_text(&q, 2)); |
| @@ -975,11 +987,11 @@ | |
| 975 | ); |
| 976 | while( db_step(&q)==SQLITE_ROW ){ |
| 977 | fossil_print("attachment: %s\n", db_column_text(&q,0)); |
| 978 | fossil_print(" attached to %s %s\n", |
| 979 | db_column_text(&q,5), db_column_text(&q,4)); |
| 980 | if( verboseFlag ){ |
| 981 | fossil_print(" via %s (%d)\n", |
| 982 | db_column_text(&q,7), db_column_int(&q,6)); |
| 983 | }else{ |
| 984 | fossil_print(" via %s\n", |
| 985 | db_column_text(&q,7)); |
| 986 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -844,14 +844,22 @@ | |
| 844 | default: break; |
| 845 | } |
| 846 | return zType; |
| 847 | } |
| 848 | |
| 849 | /* |
| 850 | ** Flag values for whatis_rid(). |
| 851 | */ |
| 852 | #if INTERFACE |
| 853 | #define WHATIS_VERBOSE 0x01 /* Extra output */ |
| 854 | #define WHATIS_BRIEF 0x02 /* Omit unnecessary output */ |
| 855 | #endif |
| 856 | |
| 857 | /* |
| 858 | ** Generate a description of artifact "rid" |
| 859 | */ |
| 860 | void whatis_rid(int rid, int flags){ |
| 861 | Stmt q; |
| 862 | int cnt; |
| 863 | |
| 864 | /* Basic information about the object. */ |
| 865 | db_prepare(&q, |
| @@ -859,11 +867,11 @@ | |
| 867 | " FROM blob, rcvfrom" |
| 868 | " WHERE rid=%d" |
| 869 | " AND rcvfrom.rcvid=blob.rcvid", |
| 870 | rid); |
| 871 | if( db_step(&q)==SQLITE_ROW ){ |
| 872 | if( flags & WHATIS_VERBOSE ){ |
| 873 | fossil_print("artifact: %s (%d)\n", db_column_text(&q,0), rid); |
| 874 | fossil_print("size: %d bytes\n", db_column_int(&q,1)); |
| 875 | fossil_print("received: %s from %s\n", |
| 876 | db_column_text(&q, 2), |
| 877 | db_column_text(&q, 3)); |
| @@ -940,13 +948,17 @@ | |
| 948 | " FROM mlink, filename, blob, event" |
| 949 | " WHERE mlink.fid=%d" |
| 950 | " AND filename.fnid=mlink.fnid" |
| 951 | " AND event.objid=mlink.mid" |
| 952 | " AND blob.rid=mlink.mid" |
| 953 | " ORDER BY event.mtime %s /*sort*/", |
| 954 | rid, |
| 955 | (flags & WHATIS_BRIEF) ? "LIMIT 1" : "DESC"); |
| 956 | while( db_step(&q)==SQLITE_ROW ){ |
| 957 | if( flags & WHATIS_BRIEF ){ |
| 958 | fossil_print("mtime: %s\n", db_column_text(&q,2)); |
| 959 | } |
| 960 | fossil_print("file: %s\n", db_column_text(&q,0)); |
| 961 | fossil_print(" part of [%S] by %s on %s\n", |
| 962 | db_column_text(&q, 1), |
| 963 | db_column_text(&q, 3), |
| 964 | db_column_text(&q, 2)); |
| @@ -975,11 +987,11 @@ | |
| 987 | ); |
| 988 | while( db_step(&q)==SQLITE_ROW ){ |
| 989 | fossil_print("attachment: %s\n", db_column_text(&q,0)); |
| 990 | fossil_print(" attached to %s %s\n", |
| 991 | db_column_text(&q,5), db_column_text(&q,4)); |
| 992 | if( flags & WHATIS_VERBOSE ){ |
| 993 | fossil_print(" via %s (%d)\n", |
| 994 | db_column_text(&q,7), db_column_int(&q,6)); |
| 995 | }else{ |
| 996 | fossil_print(" via %s\n", |
| 997 | db_column_text(&q,7)); |
| 998 |
+104
-8
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -481,13 +481,14 @@ | ||
| 481 | 481 | ** COMMAND: remote-url* |
| 482 | 482 | ** |
| 483 | 483 | ** Usage: %fossil remote ?SUBCOMMAND ...? |
| 484 | 484 | ** |
| 485 | 485 | ** View or modify the URLs of remote repositories used for syncing. |
| 486 | -** The "default" remote is the URL used in the most recent "sync", | |
| 487 | -** "push", "pull", "clone", or similar command. The default remote can | |
| 488 | -** change with each sync command. Other named remotes are persistent. | |
| 486 | +** The "default" remote is specially named by Fossil and corresponds to | |
| 487 | +** the URL used in the most recent "sync", "push", "pull", "clone", or | |
| 488 | +** similar command. As such, the default remote can be updated by | |
| 489 | +** Fossil with each sync command. Other named remotes are persistent. | |
| 489 | 490 | ** |
| 490 | 491 | ** > fossil remote |
| 491 | 492 | ** |
| 492 | 493 | ** With no arguments, this command shows the current default remote |
| 493 | 494 | ** URL. If there is no default, it shows "off". |
| @@ -494,12 +495,14 @@ | ||
| 494 | 495 | ** |
| 495 | 496 | ** > fossil remote add NAME URL |
| 496 | 497 | ** |
| 497 | 498 | ** Add a new named URL. Afterwards, NAME can be used as a short |
| 498 | 499 | ** symbolic name for URL in contexts where a URL is required. The |
| 499 | -** URL argument can be "default" or a prior symbolic name, to make | |
| 500 | -** a copy of an existing URL under a new name. | |
| 500 | +** URL argument can be "default" or a prior symbolic name to make | |
| 501 | +** a copy of an existing URL under the new NAME. The "default" | |
| 502 | +** remote cannot be defined with this subcommand; instead, | |
| 503 | +** use 'fossil remote REF' as documented below. | |
| 501 | 504 | ** |
| 502 | 505 | ** > fossil remote config-data |
| 503 | 506 | ** |
| 504 | 507 | ** DEBUG USE ONLY - Show the name and value of every CONFIG table |
| 505 | 508 | ** entry in the repository that is associated with the remote URL store. |
| @@ -507,10 +510,18 @@ | ||
| 507 | 510 | ** |
| 508 | 511 | ** > fossil remote delete NAME |
| 509 | 512 | ** |
| 510 | 513 | ** Delete a named URL previously created by the "add" subcommand. |
| 511 | 514 | ** |
| 515 | +** > fossil remote hyperlink ?FILENAME? ?LINENUM? ?LINENUM? | |
| 516 | +** | |
| 517 | +** Print a URL that will access the current checkout on the remote | |
| 518 | +** repository. Or if the FILENAME argument is included, print the | |
| 519 | +** URL to access that particular file within the current checkout. | |
| 520 | +** If one or two linenumber arguments are provided after the filename, | |
| 521 | +** then the URL is for the line or range of lines specified. | |
| 522 | +** | |
| 512 | 523 | ** > fossil remote list|ls |
| 513 | 524 | ** |
| 514 | 525 | ** Show all remote repository URLs. |
| 515 | 526 | ** |
| 516 | 527 | ** > fossil remote off |
| @@ -532,10 +543,19 @@ | ||
| 532 | 543 | ** |
| 533 | 544 | ** Forget any saved passwords for remote repositories, but continue |
| 534 | 545 | ** to remember the URLs themselves. You will be prompted for the |
| 535 | 546 | ** password the next time it is needed. |
| 536 | 547 | ** |
| 548 | +** > fossil remote ui ?FILENAME? ?LINENUM? ?LINENUM? | |
| 549 | +** | |
| 550 | +** Bring up a web browser pointing at the remote repository, and | |
| 551 | +** specifically to the page that describes the current checkout | |
| 552 | +** on that remote repository. Or if FILENAME and/or LINENUM arguments | |
| 553 | +** are provided, to the specific file and range of lines. This | |
| 554 | +** command is similar to "fossil remote hyperlink" except that instead | |
| 555 | +** of printing the URL, it passes the URL off to the web browser. | |
| 556 | +** | |
| 537 | 557 | ** > fossil remote REF |
| 538 | 558 | ** |
| 539 | 559 | ** Make REF the new default URL, replacing the prior default. |
| 540 | 560 | ** REF may be a URL or a NAME from a prior "add". |
| 541 | 561 | */ |
| @@ -616,11 +636,14 @@ | ||
| 616 | 636 | UrlData x; |
| 617 | 637 | if( g.argc!=5 ) usage("add NAME URL"); |
| 618 | 638 | memset(&x, 0, sizeof(x)); |
| 619 | 639 | zName = g.argv[3]; |
| 620 | 640 | zUrl = g.argv[4]; |
| 621 | - if( strcmp(zName,"default")==0 ) goto remote_add_default; | |
| 641 | + if( strcmp(zName,"default")==0 ){ | |
| 642 | + fossil_fatal("update the \"default\" remote-url with 'fossil remote REF'" | |
| 643 | + "\nsee 'fossil help remote' for complete usage information"); | |
| 644 | + } | |
| 622 | 645 | db_begin_write(); |
| 623 | 646 | if( fossil_strcmp(zUrl,"default")==0 ){ |
| 624 | 647 | x.canonical = db_get("last-sync-url",0); |
| 625 | 648 | x.passwd = unobscure(db_get("last-sync-pw",0)); |
| 626 | 649 | }else{ |
| @@ -651,10 +674,84 @@ | ||
| 651 | 674 | db_multi_exec("DELETE FROM config WHERE name glob 'sync-url:%q'", zName); |
| 652 | 675 | db_multi_exec("DELETE FROM config WHERE name glob 'sync-pw:%q'", zName); |
| 653 | 676 | db_protect_pop(); |
| 654 | 677 | db_commit_transaction(); |
| 655 | 678 | return; |
| 679 | + } | |
| 680 | + if( strncmp(zArg, "hyperlink", nArg)==0 | |
| 681 | + || (nArg==2 && strcmp(zArg, "ui")==0) | |
| 682 | + ){ | |
| 683 | + char *zBase; | |
| 684 | + char *zUuid; | |
| 685 | + Blob fname; | |
| 686 | + Blob url; | |
| 687 | + char *zSubCmd = g.argv[2][0]=='u' ? "ui" : "hyperlink"; | |
| 688 | + if( !db_table_exists("localdb","vvar") ){ | |
| 689 | + fossil_fatal("the \"remote %s\" command only works from " | |
| 690 | + "within an open check-out", zSubCmd); | |
| 691 | + } | |
| 692 | + zUrl = db_get("last-sync-url", 0); | |
| 693 | + if( zUrl==0 ){ | |
| 694 | + zUrl = "http://localhost:8080/"; | |
| 695 | + } | |
| 696 | + url_parse(zUrl, 0); | |
| 697 | + if( g.url.isFile ){ | |
| 698 | + url_parse("http://localhost:8080/", 0); | |
| 699 | + } | |
| 700 | + zBase = url_nouser(&g.url); | |
| 701 | + blob_init(&url, 0, 0); | |
| 702 | + if( g.argc==3 ){ | |
| 703 | + blob_appendf(&url, "%s/info/%!S", | |
| 704 | + zBase, | |
| 705 | + db_text("???", | |
| 706 | + "SELECT uuid FROM blob, vvar" | |
| 707 | + " WHERE blob.rid=0+vvar.value" | |
| 708 | + " AND vvar.name='checkout';" | |
| 709 | + )); | |
| 710 | + }else{ | |
| 711 | + blob_init(&fname, 0, 0); | |
| 712 | + file_tree_name(g.argv[3], &fname, 0, 1); | |
| 713 | + zUuid = db_text(0, | |
| 714 | + "SELECT uuid FROM files_of_checkin" | |
| 715 | + " WHERE checkinID=(SELECT value FROM vvar WHERE name='checkout')" | |
| 716 | + " AND filename=%Q", | |
| 717 | + blob_str(&fname) | |
| 718 | + ); | |
| 719 | + if( zUuid==0 ){ | |
| 720 | + fossil_fatal("not a managed file: \"%s\"", g.argv[3]); | |
| 721 | + } | |
| 722 | + blob_appendf(&url, "%s/info/%S",zBase,zUuid); | |
| 723 | + if( g.argc>4 ){ | |
| 724 | + int ln1 = atoi(g.argv[4]); | |
| 725 | + if( ln1<=0 || sqlite3_strglob("*[^0-9]*",g.argv[4])==0 ){ | |
| 726 | + fossil_fatal("\"%s\" is not a valid line number", g.argv[4]); | |
| 727 | + } | |
| 728 | + if( g.argc>5 ){ | |
| 729 | + int ln2 = atoi(g.argv[5]); | |
| 730 | + if( ln2==0 || sqlite3_strglob("*[^0-9]*",g.argv[5])==0 ){ | |
| 731 | + fossil_fatal("\"%s\" is not a valid line number", g.argv[5]); | |
| 732 | + } | |
| 733 | + if( ln2<=ln1 ){ | |
| 734 | + fossil_fatal("second line number should be greater than the first"); | |
| 735 | + } | |
| 736 | + blob_appendf(&url,"?ln=%d,%d", ln1, ln2); | |
| 737 | + }else{ | |
| 738 | + blob_appendf(&url,"?ln=%d", ln1); | |
| 739 | + } | |
| 740 | + } | |
| 741 | + if( g.argc>6 ){ | |
| 742 | + usage(mprintf("%s ?FILENAME? ?LINENUMBER? ?LINENUMBER?", zSubCmd)); | |
| 743 | + } | |
| 744 | + } | |
| 745 | + if( g.argv[2][0]=='u' ){ | |
| 746 | + char *zCmd; | |
| 747 | + zCmd = mprintf("%s %!$ &", fossil_web_browser(), blob_str(&url)); | |
| 748 | + fossil_system(zCmd); | |
| 749 | + }else{ | |
| 750 | + fossil_print("%s\n", blob_str(&url)); | |
| 751 | + } | |
| 752 | + return; | |
| 656 | 753 | } |
| 657 | 754 | if( strncmp(zArg, "scrub", nArg)==0 ){ |
| 658 | 755 | if( g.argc!=3 ) usage("scrub"); |
| 659 | 756 | db_begin_write(); |
| 660 | 757 | db_unprotect(PROTECT_CONFIG); |
| @@ -697,20 +794,19 @@ | ||
| 697 | 794 | || sqlite3_strlike("https://%",zArg,0)==0 |
| 698 | 795 | || sqlite3_strlike("ssh:%",zArg,0)==0 |
| 699 | 796 | || sqlite3_strlike("file:%",zArg,0)==0 |
| 700 | 797 | || db_exists("SELECT 1 FROM config WHERE name='sync-url:%q'",zArg) |
| 701 | 798 | ){ |
| 702 | -remote_add_default: | |
| 703 | 799 | db_unset("last-sync-url", 0); |
| 704 | 800 | db_unset("last-sync-pw", 0); |
| 705 | 801 | url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW| |
| 706 | 802 | URL_USE_CONFIG|URL_ASK_REMEMBER_PW); |
| 707 | 803 | url_remember(); |
| 708 | 804 | return; |
| 709 | 805 | } |
| 710 | 806 | fossil_fatal("unknown command \"%s\" - should be a URL or one of: " |
| 711 | - "add delete list off", zArg); | |
| 807 | + "add delete hyperlink list off scrub", zArg); | |
| 712 | 808 | } |
| 713 | 809 | |
| 714 | 810 | /* |
| 715 | 811 | ** COMMAND: backup* |
| 716 | 812 | ** |
| 717 | 813 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -481,13 +481,14 @@ | |
| 481 | ** COMMAND: remote-url* |
| 482 | ** |
| 483 | ** Usage: %fossil remote ?SUBCOMMAND ...? |
| 484 | ** |
| 485 | ** View or modify the URLs of remote repositories used for syncing. |
| 486 | ** The "default" remote is the URL used in the most recent "sync", |
| 487 | ** "push", "pull", "clone", or similar command. The default remote can |
| 488 | ** change with each sync command. Other named remotes are persistent. |
| 489 | ** |
| 490 | ** > fossil remote |
| 491 | ** |
| 492 | ** With no arguments, this command shows the current default remote |
| 493 | ** URL. If there is no default, it shows "off". |
| @@ -494,12 +495,14 @@ | |
| 494 | ** |
| 495 | ** > fossil remote add NAME URL |
| 496 | ** |
| 497 | ** Add a new named URL. Afterwards, NAME can be used as a short |
| 498 | ** symbolic name for URL in contexts where a URL is required. The |
| 499 | ** URL argument can be "default" or a prior symbolic name, to make |
| 500 | ** a copy of an existing URL under a new name. |
| 501 | ** |
| 502 | ** > fossil remote config-data |
| 503 | ** |
| 504 | ** DEBUG USE ONLY - Show the name and value of every CONFIG table |
| 505 | ** entry in the repository that is associated with the remote URL store. |
| @@ -507,10 +510,18 @@ | |
| 507 | ** |
| 508 | ** > fossil remote delete NAME |
| 509 | ** |
| 510 | ** Delete a named URL previously created by the "add" subcommand. |
| 511 | ** |
| 512 | ** > fossil remote list|ls |
| 513 | ** |
| 514 | ** Show all remote repository URLs. |
| 515 | ** |
| 516 | ** > fossil remote off |
| @@ -532,10 +543,19 @@ | |
| 532 | ** |
| 533 | ** Forget any saved passwords for remote repositories, but continue |
| 534 | ** to remember the URLs themselves. You will be prompted for the |
| 535 | ** password the next time it is needed. |
| 536 | ** |
| 537 | ** > fossil remote REF |
| 538 | ** |
| 539 | ** Make REF the new default URL, replacing the prior default. |
| 540 | ** REF may be a URL or a NAME from a prior "add". |
| 541 | */ |
| @@ -616,11 +636,14 @@ | |
| 616 | UrlData x; |
| 617 | if( g.argc!=5 ) usage("add NAME URL"); |
| 618 | memset(&x, 0, sizeof(x)); |
| 619 | zName = g.argv[3]; |
| 620 | zUrl = g.argv[4]; |
| 621 | if( strcmp(zName,"default")==0 ) goto remote_add_default; |
| 622 | db_begin_write(); |
| 623 | if( fossil_strcmp(zUrl,"default")==0 ){ |
| 624 | x.canonical = db_get("last-sync-url",0); |
| 625 | x.passwd = unobscure(db_get("last-sync-pw",0)); |
| 626 | }else{ |
| @@ -651,10 +674,84 @@ | |
| 651 | db_multi_exec("DELETE FROM config WHERE name glob 'sync-url:%q'", zName); |
| 652 | db_multi_exec("DELETE FROM config WHERE name glob 'sync-pw:%q'", zName); |
| 653 | db_protect_pop(); |
| 654 | db_commit_transaction(); |
| 655 | return; |
| 656 | } |
| 657 | if( strncmp(zArg, "scrub", nArg)==0 ){ |
| 658 | if( g.argc!=3 ) usage("scrub"); |
| 659 | db_begin_write(); |
| 660 | db_unprotect(PROTECT_CONFIG); |
| @@ -697,20 +794,19 @@ | |
| 697 | || sqlite3_strlike("https://%",zArg,0)==0 |
| 698 | || sqlite3_strlike("ssh:%",zArg,0)==0 |
| 699 | || sqlite3_strlike("file:%",zArg,0)==0 |
| 700 | || db_exists("SELECT 1 FROM config WHERE name='sync-url:%q'",zArg) |
| 701 | ){ |
| 702 | remote_add_default: |
| 703 | db_unset("last-sync-url", 0); |
| 704 | db_unset("last-sync-pw", 0); |
| 705 | url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW| |
| 706 | URL_USE_CONFIG|URL_ASK_REMEMBER_PW); |
| 707 | url_remember(); |
| 708 | return; |
| 709 | } |
| 710 | fossil_fatal("unknown command \"%s\" - should be a URL or one of: " |
| 711 | "add delete list off", zArg); |
| 712 | } |
| 713 | |
| 714 | /* |
| 715 | ** COMMAND: backup* |
| 716 | ** |
| 717 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -481,13 +481,14 @@ | |
| 481 | ** COMMAND: remote-url* |
| 482 | ** |
| 483 | ** Usage: %fossil remote ?SUBCOMMAND ...? |
| 484 | ** |
| 485 | ** View or modify the URLs of remote repositories used for syncing. |
| 486 | ** The "default" remote is specially named by Fossil and corresponds to |
| 487 | ** the URL used in the most recent "sync", "push", "pull", "clone", or |
| 488 | ** similar command. As such, the default remote can be updated by |
| 489 | ** Fossil with each sync command. Other named remotes are persistent. |
| 490 | ** |
| 491 | ** > fossil remote |
| 492 | ** |
| 493 | ** With no arguments, this command shows the current default remote |
| 494 | ** URL. If there is no default, it shows "off". |
| @@ -494,12 +495,14 @@ | |
| 495 | ** |
| 496 | ** > fossil remote add NAME URL |
| 497 | ** |
| 498 | ** Add a new named URL. Afterwards, NAME can be used as a short |
| 499 | ** symbolic name for URL in contexts where a URL is required. The |
| 500 | ** URL argument can be "default" or a prior symbolic name to make |
| 501 | ** a copy of an existing URL under the new NAME. The "default" |
| 502 | ** remote cannot be defined with this subcommand; instead, |
| 503 | ** use 'fossil remote REF' as documented below. |
| 504 | ** |
| 505 | ** > fossil remote config-data |
| 506 | ** |
| 507 | ** DEBUG USE ONLY - Show the name and value of every CONFIG table |
| 508 | ** entry in the repository that is associated with the remote URL store. |
| @@ -507,10 +510,18 @@ | |
| 510 | ** |
| 511 | ** > fossil remote delete NAME |
| 512 | ** |
| 513 | ** Delete a named URL previously created by the "add" subcommand. |
| 514 | ** |
| 515 | ** > fossil remote hyperlink ?FILENAME? ?LINENUM? ?LINENUM? |
| 516 | ** |
| 517 | ** Print a URL that will access the current checkout on the remote |
| 518 | ** repository. Or if the FILENAME argument is included, print the |
| 519 | ** URL to access that particular file within the current checkout. |
| 520 | ** If one or two linenumber arguments are provided after the filename, |
| 521 | ** then the URL is for the line or range of lines specified. |
| 522 | ** |
| 523 | ** > fossil remote list|ls |
| 524 | ** |
| 525 | ** Show all remote repository URLs. |
| 526 | ** |
| 527 | ** > fossil remote off |
| @@ -532,10 +543,19 @@ | |
| 543 | ** |
| 544 | ** Forget any saved passwords for remote repositories, but continue |
| 545 | ** to remember the URLs themselves. You will be prompted for the |
| 546 | ** password the next time it is needed. |
| 547 | ** |
| 548 | ** > fossil remote ui ?FILENAME? ?LINENUM? ?LINENUM? |
| 549 | ** |
| 550 | ** Bring up a web browser pointing at the remote repository, and |
| 551 | ** specifically to the page that describes the current checkout |
| 552 | ** on that remote repository. Or if FILENAME and/or LINENUM arguments |
| 553 | ** are provided, to the specific file and range of lines. This |
| 554 | ** command is similar to "fossil remote hyperlink" except that instead |
| 555 | ** of printing the URL, it passes the URL off to the web browser. |
| 556 | ** |
| 557 | ** > fossil remote REF |
| 558 | ** |
| 559 | ** Make REF the new default URL, replacing the prior default. |
| 560 | ** REF may be a URL or a NAME from a prior "add". |
| 561 | */ |
| @@ -616,11 +636,14 @@ | |
| 636 | UrlData x; |
| 637 | if( g.argc!=5 ) usage("add NAME URL"); |
| 638 | memset(&x, 0, sizeof(x)); |
| 639 | zName = g.argv[3]; |
| 640 | zUrl = g.argv[4]; |
| 641 | if( strcmp(zName,"default")==0 ){ |
| 642 | fossil_fatal("update the \"default\" remote-url with 'fossil remote REF'" |
| 643 | "\nsee 'fossil help remote' for complete usage information"); |
| 644 | } |
| 645 | db_begin_write(); |
| 646 | if( fossil_strcmp(zUrl,"default")==0 ){ |
| 647 | x.canonical = db_get("last-sync-url",0); |
| 648 | x.passwd = unobscure(db_get("last-sync-pw",0)); |
| 649 | }else{ |
| @@ -651,10 +674,84 @@ | |
| 674 | db_multi_exec("DELETE FROM config WHERE name glob 'sync-url:%q'", zName); |
| 675 | db_multi_exec("DELETE FROM config WHERE name glob 'sync-pw:%q'", zName); |
| 676 | db_protect_pop(); |
| 677 | db_commit_transaction(); |
| 678 | return; |
| 679 | } |
| 680 | if( strncmp(zArg, "hyperlink", nArg)==0 |
| 681 | || (nArg==2 && strcmp(zArg, "ui")==0) |
| 682 | ){ |
| 683 | char *zBase; |
| 684 | char *zUuid; |
| 685 | Blob fname; |
| 686 | Blob url; |
| 687 | char *zSubCmd = g.argv[2][0]=='u' ? "ui" : "hyperlink"; |
| 688 | if( !db_table_exists("localdb","vvar") ){ |
| 689 | fossil_fatal("the \"remote %s\" command only works from " |
| 690 | "within an open check-out", zSubCmd); |
| 691 | } |
| 692 | zUrl = db_get("last-sync-url", 0); |
| 693 | if( zUrl==0 ){ |
| 694 | zUrl = "http://localhost:8080/"; |
| 695 | } |
| 696 | url_parse(zUrl, 0); |
| 697 | if( g.url.isFile ){ |
| 698 | url_parse("http://localhost:8080/", 0); |
| 699 | } |
| 700 | zBase = url_nouser(&g.url); |
| 701 | blob_init(&url, 0, 0); |
| 702 | if( g.argc==3 ){ |
| 703 | blob_appendf(&url, "%s/info/%!S", |
| 704 | zBase, |
| 705 | db_text("???", |
| 706 | "SELECT uuid FROM blob, vvar" |
| 707 | " WHERE blob.rid=0+vvar.value" |
| 708 | " AND vvar.name='checkout';" |
| 709 | )); |
| 710 | }else{ |
| 711 | blob_init(&fname, 0, 0); |
| 712 | file_tree_name(g.argv[3], &fname, 0, 1); |
| 713 | zUuid = db_text(0, |
| 714 | "SELECT uuid FROM files_of_checkin" |
| 715 | " WHERE checkinID=(SELECT value FROM vvar WHERE name='checkout')" |
| 716 | " AND filename=%Q", |
| 717 | blob_str(&fname) |
| 718 | ); |
| 719 | if( zUuid==0 ){ |
| 720 | fossil_fatal("not a managed file: \"%s\"", g.argv[3]); |
| 721 | } |
| 722 | blob_appendf(&url, "%s/info/%S",zBase,zUuid); |
| 723 | if( g.argc>4 ){ |
| 724 | int ln1 = atoi(g.argv[4]); |
| 725 | if( ln1<=0 || sqlite3_strglob("*[^0-9]*",g.argv[4])==0 ){ |
| 726 | fossil_fatal("\"%s\" is not a valid line number", g.argv[4]); |
| 727 | } |
| 728 | if( g.argc>5 ){ |
| 729 | int ln2 = atoi(g.argv[5]); |
| 730 | if( ln2==0 || sqlite3_strglob("*[^0-9]*",g.argv[5])==0 ){ |
| 731 | fossil_fatal("\"%s\" is not a valid line number", g.argv[5]); |
| 732 | } |
| 733 | if( ln2<=ln1 ){ |
| 734 | fossil_fatal("second line number should be greater than the first"); |
| 735 | } |
| 736 | blob_appendf(&url,"?ln=%d,%d", ln1, ln2); |
| 737 | }else{ |
| 738 | blob_appendf(&url,"?ln=%d", ln1); |
| 739 | } |
| 740 | } |
| 741 | if( g.argc>6 ){ |
| 742 | usage(mprintf("%s ?FILENAME? ?LINENUMBER? ?LINENUMBER?", zSubCmd)); |
| 743 | } |
| 744 | } |
| 745 | if( g.argv[2][0]=='u' ){ |
| 746 | char *zCmd; |
| 747 | zCmd = mprintf("%s %!$ &", fossil_web_browser(), blob_str(&url)); |
| 748 | fossil_system(zCmd); |
| 749 | }else{ |
| 750 | fossil_print("%s\n", blob_str(&url)); |
| 751 | } |
| 752 | return; |
| 753 | } |
| 754 | if( strncmp(zArg, "scrub", nArg)==0 ){ |
| 755 | if( g.argc!=3 ) usage("scrub"); |
| 756 | db_begin_write(); |
| 757 | db_unprotect(PROTECT_CONFIG); |
| @@ -697,20 +794,19 @@ | |
| 794 | || sqlite3_strlike("https://%",zArg,0)==0 |
| 795 | || sqlite3_strlike("ssh:%",zArg,0)==0 |
| 796 | || sqlite3_strlike("file:%",zArg,0)==0 |
| 797 | || db_exists("SELECT 1 FROM config WHERE name='sync-url:%q'",zArg) |
| 798 | ){ |
| 799 | db_unset("last-sync-url", 0); |
| 800 | db_unset("last-sync-pw", 0); |
| 801 | url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW| |
| 802 | URL_USE_CONFIG|URL_ASK_REMEMBER_PW); |
| 803 | url_remember(); |
| 804 | return; |
| 805 | } |
| 806 | fossil_fatal("unknown command \"%s\" - should be a URL or one of: " |
| 807 | "add delete hyperlink list off scrub", zArg); |
| 808 | } |
| 809 | |
| 810 | /* |
| 811 | ** COMMAND: backup* |
| 812 | ** |
| 813 |
+1
-1
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1594,11 +1594,11 @@ | ||
| 1594 | 1594 | ** rel ... also show related checkins |
| 1595 | 1595 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| 1596 | 1596 | ** All qualifying check-ins are shown unless there is |
| 1597 | 1597 | ** also an n= or n1= query parameter. |
| 1598 | 1598 | ** chng=GLOBLIST Show only check-ins that involve changes to a file whose |
| 1599 | -** name matches one of the comma-separate GLOBLIST | |
| 1599 | +** name matches one of the comma-separate GLOBLIST | |
| 1600 | 1600 | ** brbg Background color determined by branch name |
| 1601 | 1601 | ** ubg Background color determined by user |
| 1602 | 1602 | ** deltabg Background color red for delta manifests or green |
| 1603 | 1603 | ** for baseline manifests |
| 1604 | 1604 | ** namechng Show only check-ins that have filename changes |
| 1605 | 1605 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1594,11 +1594,11 @@ | |
| 1594 | ** rel ... also show related checkins |
| 1595 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| 1596 | ** All qualifying check-ins are shown unless there is |
| 1597 | ** also an n= or n1= query parameter. |
| 1598 | ** chng=GLOBLIST Show only check-ins that involve changes to a file whose |
| 1599 | ** name matches one of the comma-separate GLOBLIST |
| 1600 | ** brbg Background color determined by branch name |
| 1601 | ** ubg Background color determined by user |
| 1602 | ** deltabg Background color red for delta manifests or green |
| 1603 | ** for baseline manifests |
| 1604 | ** namechng Show only check-ins that have filename changes |
| 1605 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1594,11 +1594,11 @@ | |
| 1594 | ** rel ... also show related checkins |
| 1595 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| 1596 | ** All qualifying check-ins are shown unless there is |
| 1597 | ** also an n= or n1= query parameter. |
| 1598 | ** chng=GLOBLIST Show only check-ins that involve changes to a file whose |
| 1599 | ** name matches one of the comma-separate GLOBLIST |
| 1600 | ** brbg Background color determined by branch name |
| 1601 | ** ubg Background color determined by user |
| 1602 | ** deltabg Background color red for delta manifests or green |
| 1603 | ** for baseline manifests |
| 1604 | ** namechng Show only check-ins that have filename changes |
| 1605 |
+8
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -435,11 +435,18 @@ | ||
| 435 | 435 | fossil_print("CONFLICT %s\n", zName); |
| 436 | 436 | nConflict++; |
| 437 | 437 | }else if( idt>0 && idv==0 ){ |
| 438 | 438 | /* File added in the target. */ |
| 439 | 439 | if( file_isfile_or_link(zFullPath) ){ |
| 440 | - fossil_print("ADD %s - overwrites an unmanaged file\n", zName); | |
| 440 | + /* Name of backup file with Original content */ | |
| 441 | + char *zOrig = file_newname(zFullPath, "original", 1); | |
| 442 | + /* Backup previously unanaged file before to be overwritten */ | |
| 443 | + file_copy(zFullPath, zOrig); | |
| 444 | + fossil_free(zOrig); | |
| 445 | + fossil_print("ADD %s - overwrites an unmanaged file", zName); | |
| 446 | + if( !dryRunFlag ) fossil_print(", original copy backed up locally"); | |
| 447 | + fossil_print("\n"); | |
| 441 | 448 | nOverwrite++; |
| 442 | 449 | }else{ |
| 443 | 450 | fossil_print("ADD %s\n", zName); |
| 444 | 451 | } |
| 445 | 452 | if( !dryRunFlag && !internalUpdate ) undo_save(zName); |
| 446 | 453 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -435,11 +435,18 @@ | |
| 435 | fossil_print("CONFLICT %s\n", zName); |
| 436 | nConflict++; |
| 437 | }else if( idt>0 && idv==0 ){ |
| 438 | /* File added in the target. */ |
| 439 | if( file_isfile_or_link(zFullPath) ){ |
| 440 | fossil_print("ADD %s - overwrites an unmanaged file\n", zName); |
| 441 | nOverwrite++; |
| 442 | }else{ |
| 443 | fossil_print("ADD %s\n", zName); |
| 444 | } |
| 445 | if( !dryRunFlag && !internalUpdate ) undo_save(zName); |
| 446 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -435,11 +435,18 @@ | |
| 435 | fossil_print("CONFLICT %s\n", zName); |
| 436 | nConflict++; |
| 437 | }else if( idt>0 && idv==0 ){ |
| 438 | /* File added in the target. */ |
| 439 | if( file_isfile_or_link(zFullPath) ){ |
| 440 | /* Name of backup file with Original content */ |
| 441 | char *zOrig = file_newname(zFullPath, "original", 1); |
| 442 | /* Backup previously unanaged file before to be overwritten */ |
| 443 | file_copy(zFullPath, zOrig); |
| 444 | fossil_free(zOrig); |
| 445 | fossil_print("ADD %s - overwrites an unmanaged file", zName); |
| 446 | if( !dryRunFlag ) fossil_print(", original copy backed up locally"); |
| 447 | fossil_print("\n"); |
| 448 | nOverwrite++; |
| 449 | }else{ |
| 450 | fossil_print("ADD %s\n", zName); |
| 451 | } |
| 452 | if( !dryRunFlag && !internalUpdate ) undo_save(zName); |
| 453 |
+1
-1
| --- www/encryptedrepos.wiki | ||
| +++ www/encryptedrepos.wiki | ||
| @@ -4,11 +4,11 @@ | ||
| 4 | 4 | the [https://www.sqlite.org/see/doc/trunk/www/readme.wiki|SQLite Encryption Extension]. |
| 5 | 5 | This technical note explains the process. |
| 6 | 6 | </blockquote> |
| 7 | 7 | <h2>Building An Encryption-Enabled Fossil</h2><blockquote> |
| 8 | 8 | The SQLite Encryption Extension (SEE) is proprietary software and requires |
| 9 | -[http://www.hwaci.com/cgi-bin/see-step1|purchasing a license]. | |
| 9 | +[https://sqlite.org/purchase/see|purchasing a license]. | |
| 10 | 10 | <p> |
| 11 | 11 | Assuming you have an SEE license, the first step of compiling Fossil to |
| 12 | 12 | use SEE is to create an SEE-enabled version of the SQLite database source code. |
| 13 | 13 | This alternative SQLite database source file should be called "sqlite3-see.c" |
| 14 | 14 | and should be placed in the extsrc/ subfolder of the Fossil sources, right beside |
| 15 | 15 |
| --- www/encryptedrepos.wiki | |
| +++ www/encryptedrepos.wiki | |
| @@ -4,11 +4,11 @@ | |
| 4 | the [https://www.sqlite.org/see/doc/trunk/www/readme.wiki|SQLite Encryption Extension]. |
| 5 | This technical note explains the process. |
| 6 | </blockquote> |
| 7 | <h2>Building An Encryption-Enabled Fossil</h2><blockquote> |
| 8 | The SQLite Encryption Extension (SEE) is proprietary software and requires |
| 9 | [http://www.hwaci.com/cgi-bin/see-step1|purchasing a license]. |
| 10 | <p> |
| 11 | Assuming you have an SEE license, the first step of compiling Fossil to |
| 12 | use SEE is to create an SEE-enabled version of the SQLite database source code. |
| 13 | This alternative SQLite database source file should be called "sqlite3-see.c" |
| 14 | and should be placed in the extsrc/ subfolder of the Fossil sources, right beside |
| 15 |
| --- www/encryptedrepos.wiki | |
| +++ www/encryptedrepos.wiki | |
| @@ -4,11 +4,11 @@ | |
| 4 | the [https://www.sqlite.org/see/doc/trunk/www/readme.wiki|SQLite Encryption Extension]. |
| 5 | This technical note explains the process. |
| 6 | </blockquote> |
| 7 | <h2>Building An Encryption-Enabled Fossil</h2><blockquote> |
| 8 | The SQLite Encryption Extension (SEE) is proprietary software and requires |
| 9 | [https://sqlite.org/purchase/see|purchasing a license]. |
| 10 | <p> |
| 11 | Assuming you have an SEE license, the first step of compiling Fossil to |
| 12 | use SEE is to create an SEE-enabled version of the SQLite database source code. |
| 13 | This alternative SQLite database source file should be called "sqlite3-see.c" |
| 14 | and should be placed in the extsrc/ subfolder of the Fossil sources, right beside |
| 15 |