Fossil SCM

Merge trunk into markdown-tagrefs branch.

stephan 2022-09-26 08:11 markdown-tagrefs merge
Commit 7321b44acf26a4bed61b2a39a50b8e95855eeb7d0102bca66ab6a05150ff3ec7
+7 -3
--- src/browse.c
+++ src/browse.c
@@ -845,17 +845,17 @@
845845
@ <h2>%s(zObjType) in the %z(href("%R/info?name=tip"))latest check-in</a>
846846
}else if( isBranchCI ){
847847
@ <h2>%s(zObjType) in the %z(href("%R/info?name=%T",zCI))latest check-in\
848848
@ </a> for branch %z(href("%R/timeline?r=%T",zCI))%h(zCI)</a>
849849
if( blob_size(&dirname) ){
850
- @ and %s(blob_str(&dirname))</h2>
850
+ @ and %s(blob_str(&dirname))
851851
}
852852
}else if( zCI ){
853853
@ <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>
855855
if( blob_size(&dirname) ){
856
- @ and %s(blob_str(&dirname))</h2>
856
+ @ and %s(blob_str(&dirname))
857857
}
858858
}else{
859859
int n = db_int(0, "SELECT count(*) FROM plink");
860860
@ <h2>%s(zObjType) from all %d(n) check-ins %s(blob_str(&dirname))
861861
}
@@ -863,10 +863,14 @@
863863
@ sorted by modification time</h2>
864864
}else{
865865
@ sorted by filename</h2>
866866
}
867867
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
+ }
868872
869873
/* Generate tree of lists.
870874
**
871875
** Each file and directory is a list element: <li>. Files have class=file
872876
** and if the filename as the suffix "xyz" the file also has class=file-xyz.
873877
--- 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 @@
9797
}else if( isDir==0 ){
9898
fossil_warning("not found: %s", &zName[nRoot]);
9999
}else if( file_access(zName, R_OK) ){
100100
fossil_fatal("cannot open %s", &zName[nRoot]);
101101
}else{
102
+ /* Only add unmanaged file paths specified on the command line. */
102103
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]
105108
);
106109
}
107110
blob_reset(&name);
108111
}
109112
}
110113
--- 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
--- src/default.css
+++ src/default.css
@@ -580,10 +580,11 @@
580580
table.diff td.difftxt > pre {
581581
min-width: 100%;
582582
max-width: 100%;
583583
}
584584
table.diff td > pre {
585
+ box-sizing: border-box;
585586
/* Workaround for "slight wiggle" when using mouse-wheel in some FF
586587
versions, apparently caused by the increased line-height forcing
587588
these elements to be a *tick* larger than they should be but not
588589
large enough to force a scroll bar to show up. */
589590
overflow-y: hidden;
590591
--- 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 @@
3131
** For the -l|--log mode: If "-b|--brief" is specified one line per revision
3232
** is printed, otherwise the full comment is printed. The "-n|--limit N"
3333
** and "--offset P" options limits the output to the first N changes
3434
** after skipping P changes.
3535
**
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.
3841
**
3942
** In the -s mode prints the status as <status> <revision>. This is
4043
** a quick status and does not check for up-to-date-ness of the file.
4144
**
4245
** In the -p mode, there's an optional flag "-r|--revision REVISION".
@@ -44,22 +47,24 @@
4447
** to stdout. The -p mode is another form of the "cat" command.
4548
**
4649
** Options:
4750
** -b|--brief Display a brief (one line / revision) summary
4851
** --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
5154
** -l|--log Select log mode (the default)
5255
** -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.
5457
** --offset P Skip P changes
5558
** -p|--print Select print mode
5659
** -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)
5861
** -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
5964
** -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.
6166
**
6267
** See also: [[artifact]], [[cat]], [[descendants]], [[info]], [[leaves]]
6368
*/
6469
void finfo_cmd(void){
6570
db_must_be_within_tree();
@@ -142,26 +147,28 @@
142147
blob_reset(&record);
143148
blob_reset(&fname);
144149
}else if( find_option("id","i",0) ){
145150
Blob fname;
146151
int rid;
152
+ int whatisFlags = WHATIS_BRIEF;
147153
const char *zRevision = find_option("revision", "r", 1);
154
+ if( find_option("verbose","v",0)!=0 ) whatisFlags = 0;
148155
149156
verify_all_options();
150157
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");
153160
file_tree_name(g.argv[2], &fname, 0, 1);
154161
rid = db_int(0, "SELECT rid FROM blob WHERE uuid ="
155162
" (SELECT uuid FROM files_of_checkin(%Q)"
156163
" WHERE filename=%B %s)",
157164
zRevision, &fname, filename_collation());
158165
if( rid==0 ) {
159166
fossil_fatal("file not found for revision %s: %s",
160167
zRevision, blob_str(&fname));
161168
}
162
- whatis_rid(rid,0);
169
+ whatis_rid(rid,whatisFlags);
163170
blob_reset(&fname);
164171
}else{
165172
Blob line;
166173
Stmt q;
167174
Blob fname;
168175
--- 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 @@
24532453
url_add_parameter(&url, "name", zName);
24542454
url_add_parameter(&url, "ci", zCI); /* no-op if zCI is NULL */
24552455
24562456
if( zCI==0 && !isFile ){
24572457
/* 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.
24592459
** For /file, a name= without a ci= will prefer to use the default
24602460
** "tip" value for ci=. */
24612461
rid = name_to_rid(zName);
24622462
}
24632463
if( rid==0 ){
24642464
--- 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 @@
30483048
** result in fewer HTTP requests than the separate mode.
30493049
** --mainmenu FILE Override the mainmenu config setting with the contents
30503050
** of the given file.
30513051
** --max-latency N Do not let any single HTTP request run for more than N
30523052
** 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
30543054
** "fossil ui" command.
30553055
** --nocompress Do not compress HTTP replies
30563056
** --nojail Drop root privileges but do not enter the chroot jail
30573057
** --nossl do not force redirects to SSL even if the repository
30583058
** setting "redirect-to-https" requests it. This is set
30593059
** by default for the "ui" command.
30603060
** --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"
30623062
** --pkey FILE Read the private key used for TLS from FILE.
30633063
** -P|--port TCPPORT listen to request on port TCPPORT
30643064
** --repolist If REPOSITORY is dir, URL "/" lists repos.
30653065
** --scgi Accept SCGI rather than HTTP
30663066
** --skin LABEL Use override skin LABEL
@@ -3124,11 +3124,11 @@
31243124
g.useLocalauth = find_option("localauth", 0, 0)!=0;
31253125
Th_InitTraceLog();
31263126
zPort = find_option("port", "P", 1);
31273127
isUiCmd = g.argv[1][0]=='u';
31283128
if( isUiCmd ){
3129
- zInitPage = find_option("page", 0, 1);
3129
+ zInitPage = find_option("page", "p", 1);
31303130
if( zInitPage && zInitPage[0]=='/' ) zInitPage++;
31313131
zFossilCmd = find_option("fossilcmd", 0, 1);
31323132
}
31333133
zNotFound = find_option("notfound", 0, 1);
31343134
allowRepoList = find_option("repolist",0,0)!=0;
@@ -3138,11 +3138,11 @@
31383138
if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
31393139
if( zAltBase ){
31403140
set_base_url(zAltBase);
31413141
}
31423142
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;
31443144
decode_ssl_options();
31453145
if( find_option("https",0,0)!=0 || g.httpUseSSL ){
31463146
cgi_replace_parameter("HTTPS","on");
31473147
}
31483148
if( find_option("localhost", 0, 0)!=0 ){
@@ -3230,10 +3230,11 @@
32303230
}
32313231
zPort += i+1;
32323232
}
32333233
}
32343234
iPort = mxPort = atoi(zPort);
3235
+ if( iPort<=0 ) fossil_fatal("port number must be greater than zero");
32353236
}else{
32363237
iPort = db_get_int("http-port", 8080);
32373238
mxPort = iPort+100;
32383239
}
32393240
if( isUiCmd && !fNoBrowser ){
32403241
--- 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 @@
10141014
);
10151015
zName = db_column_text(&q, 1);
10161016
zFullName = mprintf("%s%s", g.zLocalRoot, zName);
10171017
if( file_isfile_or_link(zFullName)
10181018
&& !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");
10201027
nOverwrite++;
10211028
}else{
10221029
fossil_print("ADDED %s\n", zName);
10231030
}
10241031
fossil_free(zFullName);
10251032
--- 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 @@
844844
default: break;
845845
}
846846
return zType;
847847
}
848848
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
+
849857
/*
850858
** Generate a description of artifact "rid"
851859
*/
852
-void whatis_rid(int rid, int verboseFlag){
860
+void whatis_rid(int rid, int flags){
853861
Stmt q;
854862
int cnt;
855863
856864
/* Basic information about the object. */
857865
db_prepare(&q,
@@ -859,11 +867,11 @@
859867
" FROM blob, rcvfrom"
860868
" WHERE rid=%d"
861869
" AND rcvfrom.rcvid=blob.rcvid",
862870
rid);
863871
if( db_step(&q)==SQLITE_ROW ){
864
- if( verboseFlag ){
872
+ if( flags & WHATIS_VERBOSE ){
865873
fossil_print("artifact: %s (%d)\n", db_column_text(&q,0), rid);
866874
fossil_print("size: %d bytes\n", db_column_int(&q,1));
867875
fossil_print("received: %s from %s\n",
868876
db_column_text(&q, 2),
869877
db_column_text(&q, 3));
@@ -940,13 +948,17 @@
940948
" FROM mlink, filename, blob, event"
941949
" WHERE mlink.fid=%d"
942950
" AND filename.fnid=mlink.fnid"
943951
" AND event.objid=mlink.mid"
944952
" 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");
947956
while( db_step(&q)==SQLITE_ROW ){
957
+ if( flags & WHATIS_BRIEF ){
958
+ fossil_print("mtime: %s\n", db_column_text(&q,2));
959
+ }
948960
fossil_print("file: %s\n", db_column_text(&q,0));
949961
fossil_print(" part of [%S] by %s on %s\n",
950962
db_column_text(&q, 1),
951963
db_column_text(&q, 3),
952964
db_column_text(&q, 2));
@@ -975,11 +987,11 @@
975987
);
976988
while( db_step(&q)==SQLITE_ROW ){
977989
fossil_print("attachment: %s\n", db_column_text(&q,0));
978990
fossil_print(" attached to %s %s\n",
979991
db_column_text(&q,5), db_column_text(&q,4));
980
- if( verboseFlag ){
992
+ if( flags & WHATIS_VERBOSE ){
981993
fossil_print(" via %s (%d)\n",
982994
db_column_text(&q,7), db_column_int(&q,6));
983995
}else{
984996
fossil_print(" via %s\n",
985997
db_column_text(&q,7));
986998
--- 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 @@
481481
** COMMAND: remote-url*
482482
**
483483
** Usage: %fossil remote ?SUBCOMMAND ...?
484484
**
485485
** 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.
489490
**
490491
** > fossil remote
491492
**
492493
** With no arguments, this command shows the current default remote
493494
** URL. If there is no default, it shows "off".
@@ -494,12 +495,14 @@
494495
**
495496
** > fossil remote add NAME URL
496497
**
497498
** Add a new named URL. Afterwards, NAME can be used as a short
498499
** 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.
501504
**
502505
** > fossil remote config-data
503506
**
504507
** DEBUG USE ONLY - Show the name and value of every CONFIG table
505508
** entry in the repository that is associated with the remote URL store.
@@ -507,10 +510,18 @@
507510
**
508511
** > fossil remote delete NAME
509512
**
510513
** Delete a named URL previously created by the "add" subcommand.
511514
**
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
+**
512523
** > fossil remote list|ls
513524
**
514525
** Show all remote repository URLs.
515526
**
516527
** > fossil remote off
@@ -532,10 +543,19 @@
532543
**
533544
** Forget any saved passwords for remote repositories, but continue
534545
** to remember the URLs themselves. You will be prompted for the
535546
** password the next time it is needed.
536547
**
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
+**
537557
** > fossil remote REF
538558
**
539559
** Make REF the new default URL, replacing the prior default.
540560
** REF may be a URL or a NAME from a prior "add".
541561
*/
@@ -616,11 +636,14 @@
616636
UrlData x;
617637
if( g.argc!=5 ) usage("add NAME URL");
618638
memset(&x, 0, sizeof(x));
619639
zName = g.argv[3];
620640
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
+ }
622645
db_begin_write();
623646
if( fossil_strcmp(zUrl,"default")==0 ){
624647
x.canonical = db_get("last-sync-url",0);
625648
x.passwd = unobscure(db_get("last-sync-pw",0));
626649
}else{
@@ -651,10 +674,84 @@
651674
db_multi_exec("DELETE FROM config WHERE name glob 'sync-url:%q'", zName);
652675
db_multi_exec("DELETE FROM config WHERE name glob 'sync-pw:%q'", zName);
653676
db_protect_pop();
654677
db_commit_transaction();
655678
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;
656753
}
657754
if( strncmp(zArg, "scrub", nArg)==0 ){
658755
if( g.argc!=3 ) usage("scrub");
659756
db_begin_write();
660757
db_unprotect(PROTECT_CONFIG);
@@ -697,20 +794,19 @@
697794
|| sqlite3_strlike("https://%",zArg,0)==0
698795
|| sqlite3_strlike("ssh:%",zArg,0)==0
699796
|| sqlite3_strlike("file:%",zArg,0)==0
700797
|| db_exists("SELECT 1 FROM config WHERE name='sync-url:%q'",zArg)
701798
){
702
-remote_add_default:
703799
db_unset("last-sync-url", 0);
704800
db_unset("last-sync-pw", 0);
705801
url_parse(g.argv[2], URL_REMEMBER|URL_PROMPT_PW|
706802
URL_USE_CONFIG|URL_ASK_REMEMBER_PW);
707803
url_remember();
708804
return;
709805
}
710806
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);
712808
}
713809
714810
/*
715811
** COMMAND: backup*
716812
**
717813
--- 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 @@
15941594
** rel ... also show related checkins
15951595
** uf=FILE_HASH Show only check-ins that contain the given file version
15961596
** All qualifying check-ins are shown unless there is
15971597
** also an n= or n1= query parameter.
15981598
** 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
16001600
** brbg Background color determined by branch name
16011601
** ubg Background color determined by user
16021602
** deltabg Background color red for delta manifests or green
16031603
** for baseline manifests
16041604
** namechng Show only check-ins that have filename changes
16051605
--- 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 @@
435435
fossil_print("CONFLICT %s\n", zName);
436436
nConflict++;
437437
}else if( idt>0 && idv==0 ){
438438
/* File added in the target. */
439439
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");
441448
nOverwrite++;
442449
}else{
443450
fossil_print("ADD %s\n", zName);
444451
}
445452
if( !dryRunFlag && !internalUpdate ) undo_save(zName);
446453
--- 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
--- www/encryptedrepos.wiki
+++ www/encryptedrepos.wiki
@@ -4,11 +4,11 @@
44
the [https://www.sqlite.org/see/doc/trunk/www/readme.wiki|SQLite Encryption Extension].
55
This technical note explains the process.
66
</blockquote>
77
<h2>Building An Encryption-Enabled Fossil</h2><blockquote>
88
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].
1010
<p>
1111
Assuming you have an SEE license, the first step of compiling Fossil to
1212
use SEE is to create an SEE-enabled version of the SQLite database source code.
1313
This alternative SQLite database source file should be called "sqlite3-see.c"
1414
and should be placed in the extsrc/ subfolder of the Fossil sources, right beside
1515
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button