Fossil SCM

Merge in latest fixes.

andybradford 2014-04-11 18:12 short-uuid merge
Commit 5460b0cfa22de7f4a24e2cbd3959d4c1bd000d02
+8 -11
--- src/browse.c
+++ src/browse.c
@@ -85,11 +85,11 @@
8585
8686
for(i=0; zPath[i]; i=j){
8787
for(j=i; zPath[j] && zPath[j]!='/'; j++){}
8888
if( zPath[j] && g.perm.Hyperlink ){
8989
if( zCI ){
90
- char *zLink = href("%R/%s?ci=%S&name=%#T%s", zURI, zCI, j, zPath,zREx);
90
+ char *zLink = href("%R/%s?name=%#T%s&ci=%s", zURI, j, zPath, zREx, zCI);
9191
blob_appendf(pOut, "%s%z%#h</a>",
9292
zSep, zLink, j-i, &zPath[i]);
9393
}else{
9494
char *zLink = href("%R/%s?name=%#T%s", zURI, j, zPath, zREx);
9595
blob_appendf(pOut, "%s%z%#h</a>",
@@ -179,18 +179,15 @@
179179
if( linkTip ){
180180
style_submenu_element("Tip", "Tip", "%s",
181181
url_render(&sURI, "ci", "tip", 0, 0));
182182
}
183183
if( zCI ){
184
- char zShort[20];
185
- memcpy(zShort, zUuid, 10);
186
- zShort[10] = 0;
187
- @ <h2>Files of check-in [%z(href("vinfo?name=%T",zUuid))%s(zShort)</a>]
184
+ @ <h2>Files of check-in [%z(href("vinfo?name=%s",zUuid))%.10s(zUuid)</a>]
188185
@ %s(blob_str(&dirname))</h2>
189
- zSubdirLink = mprintf("%R/dir?ci=%S&name=%T", zUuid, zPrefix);
186
+ zSubdirLink = mprintf("%R/dir?ci=%s&name=%T", zUuid, zPrefix);
190187
if( nD==0 ){
191
- style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%S",
188
+ style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s",
192189
zUuid);
193190
}
194191
}else{
195192
@ <h2>The union of all files from all check-ins
196193
@ %s(blob_str(&dirname))</h2>
@@ -490,11 +487,11 @@
490487
}
491488
if( zCI ){
492489
style_submenu_element("All", "All", "%s",
493490
url_render(&sURI, "ci", 0, 0, 0));
494491
if( nD==0 && !showDirOnly ){
495
- style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%S",
492
+ style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s",
496493
zUuid);
497494
}
498495
}
499496
if( linkTrunk ){
500497
style_submenu_element("Trunk", "Trunk", "%s",
@@ -574,11 +571,11 @@
574571
if( zCI ){
575572
@ <h2>%d(nFile) %s(zObjType) of check-in
576573
if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){
577574
@ "%h(zCI)"
578575
}
579
- @ [%z(href("vinfo?name=%T",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname))</h2>
576
+ @ [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname))</h2>
580577
}else{
581578
int n = db_int(0, "SELECT count(*) FROM plink");
582579
@ <h2>%d(nFile) %s(zObjType) from all %d(n) check-ins
583580
@ %s(blob_str(&dirname))</h2>
584581
}
@@ -617,11 +614,11 @@
617614
nDir++;
618615
}else if( !showDirOnly ){
619616
const char *zFileClass = fileext_class(p->zName);
620617
char *zLink;
621618
if( zCI ){
622
- zLink = href("%R/artifact/%S",p->zUuid);
619
+ zLink = href("%R/artifact/%s",p->zUuid);
623620
}else{
624621
zLink = href("%R/finfo?name=%T",p->zFullName);
625622
}
626623
@ <li class="%z(zFileClass)%s(zLastClass)">%z(zLink)%h(p->zName)</a>
627624
}
@@ -875,14 +872,14 @@
875872
zAge[0] = 0;
876873
}
877874
@ <tr>
878875
@ <td>%s(zAge)
879876
@ <td width="25">
880
- @ <td>%z(href("%R/artifact/%S?ln", zFUuid))%h(db_column_text(&q, 3))</a>
877
+ @ <td>%z(href("%R/artifact/%s?ln", zFUuid))%h(db_column_text(&q, 3))</a>
881878
@ </tr>
882879
@
883880
}
884881
@ <tr><td colspan=3><hr></tr>
885882
@ </table>
886883
db_finalize(&q);
887884
style_footer();
888885
}
889886
--- src/browse.c
+++ src/browse.c
@@ -85,11 +85,11 @@
85
86 for(i=0; zPath[i]; i=j){
87 for(j=i; zPath[j] && zPath[j]!='/'; j++){}
88 if( zPath[j] && g.perm.Hyperlink ){
89 if( zCI ){
90 char *zLink = href("%R/%s?ci=%S&name=%#T%s", zURI, zCI, j, zPath,zREx);
91 blob_appendf(pOut, "%s%z%#h</a>",
92 zSep, zLink, j-i, &zPath[i]);
93 }else{
94 char *zLink = href("%R/%s?name=%#T%s", zURI, j, zPath, zREx);
95 blob_appendf(pOut, "%s%z%#h</a>",
@@ -179,18 +179,15 @@
179 if( linkTip ){
180 style_submenu_element("Tip", "Tip", "%s",
181 url_render(&sURI, "ci", "tip", 0, 0));
182 }
183 if( zCI ){
184 char zShort[20];
185 memcpy(zShort, zUuid, 10);
186 zShort[10] = 0;
187 @ <h2>Files of check-in [%z(href("vinfo?name=%T",zUuid))%s(zShort)</a>]
188 @ %s(blob_str(&dirname))</h2>
189 zSubdirLink = mprintf("%R/dir?ci=%S&name=%T", zUuid, zPrefix);
190 if( nD==0 ){
191 style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%S",
192 zUuid);
193 }
194 }else{
195 @ <h2>The union of all files from all check-ins
196 @ %s(blob_str(&dirname))</h2>
@@ -490,11 +487,11 @@
490 }
491 if( zCI ){
492 style_submenu_element("All", "All", "%s",
493 url_render(&sURI, "ci", 0, 0, 0));
494 if( nD==0 && !showDirOnly ){
495 style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%S",
496 zUuid);
497 }
498 }
499 if( linkTrunk ){
500 style_submenu_element("Trunk", "Trunk", "%s",
@@ -574,11 +571,11 @@
574 if( zCI ){
575 @ <h2>%d(nFile) %s(zObjType) of check-in
576 if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){
577 @ "%h(zCI)"
578 }
579 @ [%z(href("vinfo?name=%T",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname))</h2>
580 }else{
581 int n = db_int(0, "SELECT count(*) FROM plink");
582 @ <h2>%d(nFile) %s(zObjType) from all %d(n) check-ins
583 @ %s(blob_str(&dirname))</h2>
584 }
@@ -617,11 +614,11 @@
617 nDir++;
618 }else if( !showDirOnly ){
619 const char *zFileClass = fileext_class(p->zName);
620 char *zLink;
621 if( zCI ){
622 zLink = href("%R/artifact/%S",p->zUuid);
623 }else{
624 zLink = href("%R/finfo?name=%T",p->zFullName);
625 }
626 @ <li class="%z(zFileClass)%s(zLastClass)">%z(zLink)%h(p->zName)</a>
627 }
@@ -875,14 +872,14 @@
875 zAge[0] = 0;
876 }
877 @ <tr>
878 @ <td>%s(zAge)
879 @ <td width="25">
880 @ <td>%z(href("%R/artifact/%S?ln", zFUuid))%h(db_column_text(&q, 3))</a>
881 @ </tr>
882 @
883 }
884 @ <tr><td colspan=3><hr></tr>
885 @ </table>
886 db_finalize(&q);
887 style_footer();
888 }
889
--- src/browse.c
+++ src/browse.c
@@ -85,11 +85,11 @@
85
86 for(i=0; zPath[i]; i=j){
87 for(j=i; zPath[j] && zPath[j]!='/'; j++){}
88 if( zPath[j] && g.perm.Hyperlink ){
89 if( zCI ){
90 char *zLink = href("%R/%s?name=%#T%s&ci=%s", zURI, j, zPath, zREx, zCI);
91 blob_appendf(pOut, "%s%z%#h</a>",
92 zSep, zLink, j-i, &zPath[i]);
93 }else{
94 char *zLink = href("%R/%s?name=%#T%s", zURI, j, zPath, zREx);
95 blob_appendf(pOut, "%s%z%#h</a>",
@@ -179,18 +179,15 @@
179 if( linkTip ){
180 style_submenu_element("Tip", "Tip", "%s",
181 url_render(&sURI, "ci", "tip", 0, 0));
182 }
183 if( zCI ){
184 @ <h2>Files of check-in [%z(href("vinfo?name=%s",zUuid))%.10s(zUuid)</a>]
 
 
 
185 @ %s(blob_str(&dirname))</h2>
186 zSubdirLink = mprintf("%R/dir?ci=%s&name=%T", zUuid, zPrefix);
187 if( nD==0 ){
188 style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s",
189 zUuid);
190 }
191 }else{
192 @ <h2>The union of all files from all check-ins
193 @ %s(blob_str(&dirname))</h2>
@@ -490,11 +487,11 @@
487 }
488 if( zCI ){
489 style_submenu_element("All", "All", "%s",
490 url_render(&sURI, "ci", 0, 0, 0));
491 if( nD==0 && !showDirOnly ){
492 style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s",
493 zUuid);
494 }
495 }
496 if( linkTrunk ){
497 style_submenu_element("Trunk", "Trunk", "%s",
@@ -574,11 +571,11 @@
571 if( zCI ){
572 @ <h2>%d(nFile) %s(zObjType) of check-in
573 if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){
574 @ "%h(zCI)"
575 }
576 @ [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname))</h2>
577 }else{
578 int n = db_int(0, "SELECT count(*) FROM plink");
579 @ <h2>%d(nFile) %s(zObjType) from all %d(n) check-ins
580 @ %s(blob_str(&dirname))</h2>
581 }
@@ -617,11 +614,11 @@
614 nDir++;
615 }else if( !showDirOnly ){
616 const char *zFileClass = fileext_class(p->zName);
617 char *zLink;
618 if( zCI ){
619 zLink = href("%R/artifact/%s",p->zUuid);
620 }else{
621 zLink = href("%R/finfo?name=%T",p->zFullName);
622 }
623 @ <li class="%z(zFileClass)%s(zLastClass)">%z(zLink)%h(p->zName)</a>
624 }
@@ -875,14 +872,14 @@
872 zAge[0] = 0;
873 }
874 @ <tr>
875 @ <td>%s(zAge)
876 @ <td width="25">
877 @ <td>%z(href("%R/artifact/%s?ln", zFUuid))%h(db_column_text(&q, 3))</a>
878 @ </tr>
879 @
880 }
881 @ <tr><td colspan=3><hr></tr>
882 @ </table>
883 db_finalize(&q);
884 style_footer();
885 }
886
+9 -9
--- src/diff.c
+++ src/diff.c
@@ -2307,17 +2307,17 @@
23072307
clr = gradient_color(clr1, clr2, ann.nVers-1, i);
23082308
ann.aVers[i].zBgColor = mprintf("#%06x", clr);
23092309
}
23102310
23112311
if( showLog ){
2312
- char *zLink = href("%R/finfo?name=%t&ci=%S",zFilename,zCI);
2312
+ char *zLink = href("%R/finfo?name=%t&ci=%s",zFilename,zCI);
23132313
@ <h2>Ancestors of %z(zLink)%h(zFilename)</a> analyzed:</h2>
23142314
@ <ol>
23152315
for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
23162316
@ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate)
2317
- @ check-in %z(href("%R/info/%S",p->zMUuid))%.10s(p->zMUuid)</a>
2318
- @ artifact %z(href("%R/artifact/%S",p->zFUuid))%.10s(p->zFUuid)</a>
2317
+ @ check-in %z(href("%R/info/%s",p->zMUuid))%.10s(p->zMUuid)</a>
2318
+ @ artifact %z(href("%R/artifact/%s",p->zFUuid))%.10s(p->zFUuid)</a>
23192319
@ </span>
23202320
#if 0
23212321
if( i>0 ){
23222322
char *zLink = xhref("target='infowindow'",
23232323
"%R/fdiff?v1=%S&v2=%S&sbs=1",
@@ -2335,17 +2335,17 @@
23352335
@ </ol>
23362336
@ <hr>
23372337
}
23382338
if( !ann.bLimit ){
23392339
@ <h2>Origin for each line in
2340
- @ %z(href("%R/finfo?name=%h&ci=%S", zFilename, zCI))%h(zFilename)</a>
2341
- @ from check-in %z(href("%R/info/%S",zCI))%S(zCI)</a>:</h2>
2340
+ @ %z(href("%R/finfo?name=%h&ci=%s", zFilename, zCI))%h(zFilename)</a>
2341
+ @ from check-in %z(href("%R/info/%s",zCI))%S(zCI)</a>:</h2>
23422342
iLimit = ann.nVers+10;
23432343
}else{
23442344
@ <h2>Lines added by the %d(iLimit) most recent ancestors of
2345
- @ %z(href("%R/finfo?name=%h&ci=%S", zFilename, zCI))%h(zFilename)</a>
2346
- @ from check-in %z(href("%R/info/%S",zCI))%S(zCI)</a>:</h2>
2345
+ @ %z(href("%R/finfo?name=%h&ci=%s", zFilename, zCI))%h(zFilename)</a>
2346
+ @ from check-in %z(href("%R/info/%s",zCI))%S(zCI)</a>:</h2>
23472347
}
23482348
@ <pre>
23492349
for(i=0; i<ann.nOrig; i++){
23502350
int iVers = ann.aOrig[i].iVers;
23512351
char *z = (char*)ann.aOrig[i].z;
@@ -2355,11 +2355,11 @@
23552355
if( iLimit>ann.nVers && iVers<0 ) iVers = ann.nVers-1;
23562356
23572357
if( bBlame ){
23582358
if( iVers>=0 ){
23592359
struct AnnVers *p = ann.aVers+iVers;
2360
- char *zLink = xhref("target='infowindow'", "%R/info/%S", p->zMUuid);
2360
+ char *zLink = xhref("target='infowindow'", "%R/info/%s", p->zMUuid);
23612361
sqlite3_snprintf(sizeof(zPrefix), zPrefix,
23622362
"<span style='background-color:%s'>"
23632363
"%s%.10s</a> %s</span> %13.13s:",
23642364
p->zBgColor, zLink, p->zMUuid, p->zDate, p->zUser);
23652365
fossil_free(zLink);
@@ -2367,11 +2367,11 @@
23672367
sqlite3_snprintf(sizeof(zPrefix), zPrefix, "%36s", "");
23682368
}
23692369
}else{
23702370
if( iVers>=0 ){
23712371
struct AnnVers *p = ann.aVers+iVers;
2372
- char *zLink = xhref("target='infowindow'", "%R/info/%S", p->zMUuid);
2372
+ char *zLink = xhref("target='infowindow'", "%R/info/%s", p->zMUuid);
23732373
sqlite3_snprintf(sizeof(zPrefix), zPrefix,
23742374
"<span style='background-color:%s'>"
23752375
"%s%.10s</a> %s</span> %4d:",
23762376
p->zBgColor, zLink, p->zMUuid, p->zDate, i+1);
23772377
fossil_free(zLink);
23782378
--- src/diff.c
+++ src/diff.c
@@ -2307,17 +2307,17 @@
2307 clr = gradient_color(clr1, clr2, ann.nVers-1, i);
2308 ann.aVers[i].zBgColor = mprintf("#%06x", clr);
2309 }
2310
2311 if( showLog ){
2312 char *zLink = href("%R/finfo?name=%t&ci=%S",zFilename,zCI);
2313 @ <h2>Ancestors of %z(zLink)%h(zFilename)</a> analyzed:</h2>
2314 @ <ol>
2315 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2316 @ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate)
2317 @ check-in %z(href("%R/info/%S",p->zMUuid))%.10s(p->zMUuid)</a>
2318 @ artifact %z(href("%R/artifact/%S",p->zFUuid))%.10s(p->zFUuid)</a>
2319 @ </span>
2320 #if 0
2321 if( i>0 ){
2322 char *zLink = xhref("target='infowindow'",
2323 "%R/fdiff?v1=%S&v2=%S&sbs=1",
@@ -2335,17 +2335,17 @@
2335 @ </ol>
2336 @ <hr>
2337 }
2338 if( !ann.bLimit ){
2339 @ <h2>Origin for each line in
2340 @ %z(href("%R/finfo?name=%h&ci=%S", zFilename, zCI))%h(zFilename)</a>
2341 @ from check-in %z(href("%R/info/%S",zCI))%S(zCI)</a>:</h2>
2342 iLimit = ann.nVers+10;
2343 }else{
2344 @ <h2>Lines added by the %d(iLimit) most recent ancestors of
2345 @ %z(href("%R/finfo?name=%h&ci=%S", zFilename, zCI))%h(zFilename)</a>
2346 @ from check-in %z(href("%R/info/%S",zCI))%S(zCI)</a>:</h2>
2347 }
2348 @ <pre>
2349 for(i=0; i<ann.nOrig; i++){
2350 int iVers = ann.aOrig[i].iVers;
2351 char *z = (char*)ann.aOrig[i].z;
@@ -2355,11 +2355,11 @@
2355 if( iLimit>ann.nVers && iVers<0 ) iVers = ann.nVers-1;
2356
2357 if( bBlame ){
2358 if( iVers>=0 ){
2359 struct AnnVers *p = ann.aVers+iVers;
2360 char *zLink = xhref("target='infowindow'", "%R/info/%S", p->zMUuid);
2361 sqlite3_snprintf(sizeof(zPrefix), zPrefix,
2362 "<span style='background-color:%s'>"
2363 "%s%.10s</a> %s</span> %13.13s:",
2364 p->zBgColor, zLink, p->zMUuid, p->zDate, p->zUser);
2365 fossil_free(zLink);
@@ -2367,11 +2367,11 @@
2367 sqlite3_snprintf(sizeof(zPrefix), zPrefix, "%36s", "");
2368 }
2369 }else{
2370 if( iVers>=0 ){
2371 struct AnnVers *p = ann.aVers+iVers;
2372 char *zLink = xhref("target='infowindow'", "%R/info/%S", p->zMUuid);
2373 sqlite3_snprintf(sizeof(zPrefix), zPrefix,
2374 "<span style='background-color:%s'>"
2375 "%s%.10s</a> %s</span> %4d:",
2376 p->zBgColor, zLink, p->zMUuid, p->zDate, i+1);
2377 fossil_free(zLink);
2378
--- src/diff.c
+++ src/diff.c
@@ -2307,17 +2307,17 @@
2307 clr = gradient_color(clr1, clr2, ann.nVers-1, i);
2308 ann.aVers[i].zBgColor = mprintf("#%06x", clr);
2309 }
2310
2311 if( showLog ){
2312 char *zLink = href("%R/finfo?name=%t&ci=%s",zFilename,zCI);
2313 @ <h2>Ancestors of %z(zLink)%h(zFilename)</a> analyzed:</h2>
2314 @ <ol>
2315 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2316 @ <li><span style='background-color:%s(p->zBgColor);'>%s(p->zDate)
2317 @ check-in %z(href("%R/info/%s",p->zMUuid))%.10s(p->zMUuid)</a>
2318 @ artifact %z(href("%R/artifact/%s",p->zFUuid))%.10s(p->zFUuid)</a>
2319 @ </span>
2320 #if 0
2321 if( i>0 ){
2322 char *zLink = xhref("target='infowindow'",
2323 "%R/fdiff?v1=%S&v2=%S&sbs=1",
@@ -2335,17 +2335,17 @@
2335 @ </ol>
2336 @ <hr>
2337 }
2338 if( !ann.bLimit ){
2339 @ <h2>Origin for each line in
2340 @ %z(href("%R/finfo?name=%h&ci=%s", zFilename, zCI))%h(zFilename)</a>
2341 @ from check-in %z(href("%R/info/%s",zCI))%S(zCI)</a>:</h2>
2342 iLimit = ann.nVers+10;
2343 }else{
2344 @ <h2>Lines added by the %d(iLimit) most recent ancestors of
2345 @ %z(href("%R/finfo?name=%h&ci=%s", zFilename, zCI))%h(zFilename)</a>
2346 @ from check-in %z(href("%R/info/%s",zCI))%S(zCI)</a>:</h2>
2347 }
2348 @ <pre>
2349 for(i=0; i<ann.nOrig; i++){
2350 int iVers = ann.aOrig[i].iVers;
2351 char *z = (char*)ann.aOrig[i].z;
@@ -2355,11 +2355,11 @@
2355 if( iLimit>ann.nVers && iVers<0 ) iVers = ann.nVers-1;
2356
2357 if( bBlame ){
2358 if( iVers>=0 ){
2359 struct AnnVers *p = ann.aVers+iVers;
2360 char *zLink = xhref("target='infowindow'", "%R/info/%s", p->zMUuid);
2361 sqlite3_snprintf(sizeof(zPrefix), zPrefix,
2362 "<span style='background-color:%s'>"
2363 "%s%.10s</a> %s</span> %13.13s:",
2364 p->zBgColor, zLink, p->zMUuid, p->zDate, p->zUser);
2365 fossil_free(zLink);
@@ -2367,11 +2367,11 @@
2367 sqlite3_snprintf(sizeof(zPrefix), zPrefix, "%36s", "");
2368 }
2369 }else{
2370 if( iVers>=0 ){
2371 struct AnnVers *p = ann.aVers+iVers;
2372 char *zLink = xhref("target='infowindow'", "%R/info/%s", p->zMUuid);
2373 sqlite3_snprintf(sizeof(zPrefix), zPrefix,
2374 "<span style='background-color:%s'>"
2375 "%s%.10s</a> %s</span> %4d:",
2376 p->zBgColor, zLink, p->zMUuid, p->zDate, i+1);
2377 fossil_free(zLink);
2378
+2
--- src/file.c
+++ src/file.c
@@ -977,10 +977,12 @@
977977
for(j=i+1; zPwd[j]; j++){
978978
if( zPwd[j]=='/' ){
979979
blob_append(pOut, "/..", 3);
980980
}
981981
}
982
+ while( i>0 && (zPwd[i]!='/')) --i;
983
+ blob_append(pOut, zPath+i, j-i);
982984
}
983985
if( slash && i>0 && zPath[strlen(zPath)-1]=='/'){
984986
blob_append(pOut, "/", 1);
985987
}
986988
blob_reset(&tmp);
987989
--- src/file.c
+++ src/file.c
@@ -977,10 +977,12 @@
977 for(j=i+1; zPwd[j]; j++){
978 if( zPwd[j]=='/' ){
979 blob_append(pOut, "/..", 3);
980 }
981 }
 
 
982 }
983 if( slash && i>0 && zPath[strlen(zPath)-1]=='/'){
984 blob_append(pOut, "/", 1);
985 }
986 blob_reset(&tmp);
987
--- src/file.c
+++ src/file.c
@@ -977,10 +977,12 @@
977 for(j=i+1; zPwd[j]; j++){
978 if( zPwd[j]=='/' ){
979 blob_append(pOut, "/..", 3);
980 }
981 }
982 while( i>0 && (zPwd[i]!='/')) --i;
983 blob_append(pOut, zPath+i, j-i);
984 }
985 if( slash && i>0 && zPath[strlen(zPath)-1]=='/'){
986 blob_append(pOut, "/", 1);
987 }
988 blob_reset(&tmp);
989
+1 -1
--- src/info.c
+++ src/info.c
@@ -1189,11 +1189,11 @@
11891189
}
11901190
@ - %!w(zCom) (user:
11911191
hyperlink_to_user(zUser,zDate,")");
11921192
if( g.perm.Hyperlink ){
11931193
@ %z(href("%R/finfo?name=%T&ci=%s",zName,zVers))[ancestry]</a>
1194
- @ %z(href("%R/annotate?checkin=%s&filename=%T",zVers,zName))
1194
+ @ %z(href("%R/annotate?filename=%T&checkin=%s",zName,zVers))
11951195
@ [annotate]</a>
11961196
@ %z(href("%R/blame?filename=%T&checkin=%s",zName,zVers))
11971197
@ [blame]</a>
11981198
}
11991199
cnt++;
12001200
--- src/info.c
+++ src/info.c
@@ -1189,11 +1189,11 @@
1189 }
1190 @ - %!w(zCom) (user:
1191 hyperlink_to_user(zUser,zDate,")");
1192 if( g.perm.Hyperlink ){
1193 @ %z(href("%R/finfo?name=%T&ci=%s",zName,zVers))[ancestry]</a>
1194 @ %z(href("%R/annotate?checkin=%s&filename=%T",zVers,zName))
1195 @ [annotate]</a>
1196 @ %z(href("%R/blame?filename=%T&checkin=%s",zName,zVers))
1197 @ [blame]</a>
1198 }
1199 cnt++;
1200
--- src/info.c
+++ src/info.c
@@ -1189,11 +1189,11 @@
1189 }
1190 @ - %!w(zCom) (user:
1191 hyperlink_to_user(zUser,zDate,")");
1192 if( g.perm.Hyperlink ){
1193 @ %z(href("%R/finfo?name=%T&ci=%s",zName,zVers))[ancestry]</a>
1194 @ %z(href("%R/annotate?filename=%T&checkin=%s",zName,zVers))
1195 @ [annotate]</a>
1196 @ %z(href("%R/blame?filename=%T&checkin=%s",zName,zVers))
1197 @ [blame]</a>
1198 }
1199 cnt++;
1200
+1 -1
--- src/info.c
+++ src/info.c
@@ -1189,11 +1189,11 @@
11891189
}
11901190
@ - %!w(zCom) (user:
11911191
hyperlink_to_user(zUser,zDate,")");
11921192
if( g.perm.Hyperlink ){
11931193
@ %z(href("%R/finfo?name=%T&ci=%s",zName,zVers))[ancestry]</a>
1194
- @ %z(href("%R/annotate?checkin=%s&filename=%T",zVers,zName))
1194
+ @ %z(href("%R/annotate?filename=%T&checkin=%s",zName,zVers))
11951195
@ [annotate]</a>
11961196
@ %z(href("%R/blame?filename=%T&checkin=%s",zName,zVers))
11971197
@ [blame]</a>
11981198
}
11991199
cnt++;
12001200
--- src/info.c
+++ src/info.c
@@ -1189,11 +1189,11 @@
1189 }
1190 @ - %!w(zCom) (user:
1191 hyperlink_to_user(zUser,zDate,")");
1192 if( g.perm.Hyperlink ){
1193 @ %z(href("%R/finfo?name=%T&ci=%s",zName,zVers))[ancestry]</a>
1194 @ %z(href("%R/annotate?checkin=%s&filename=%T",zVers,zName))
1195 @ [annotate]</a>
1196 @ %z(href("%R/blame?filename=%T&checkin=%s",zName,zVers))
1197 @ [blame]</a>
1198 }
1199 cnt++;
1200
--- src/info.c
+++ src/info.c
@@ -1189,11 +1189,11 @@
1189 }
1190 @ - %!w(zCom) (user:
1191 hyperlink_to_user(zUser,zDate,")");
1192 if( g.perm.Hyperlink ){
1193 @ %z(href("%R/finfo?name=%T&ci=%s",zName,zVers))[ancestry]</a>
1194 @ %z(href("%R/annotate?filename=%T&checkin=%s",zName,zVers))
1195 @ [annotate]</a>
1196 @ %z(href("%R/blame?filename=%T&checkin=%s",zName,zVers))
1197 @ [blame]</a>
1198 }
1199 cnt++;
1200
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -444,12 +444,12 @@
444444
#### The directories where the OpenSSL include and library files are located.
445445
# The recommended usage here is to use the Sysinternals junction tool
446446
# to create a hard link between an "openssl-1.x" sub-directory of the
447447
# Fossil source code directory and the target OpenSSL source directory.
448448
#
449
-OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1f/include
450
-OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1f
449
+OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1g/include
450
+OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1g
451451
452452
#### Either the directory where the Tcl library is installed or the Tcl
453453
# source code directory resides (depending on the value of the macro
454454
# FOSSIL_TCL_SOURCE). If this points to the Tcl install directory,
455455
# this directory must have "include" and "lib" sub-directories. If
@@ -1012,12 +1012,12 @@
10121012
10131013
# Uncomment to enable Tcl support
10141014
# FOSSIL_ENABLE_TCL = 1
10151015
10161016
!ifdef FOSSIL_ENABLE_SSL
1017
-SSLINCDIR = $(B)\compat\openssl-1.0.1f\include
1018
-SSLLIBDIR = $(B)\compat\openssl-1.0.1f\out32
1017
+SSLINCDIR = $(B)\compat\openssl-1.0.1g\include
1018
+SSLLIBDIR = $(B)\compat\openssl-1.0.1g\out32
10191019
SSLLIB = ssleay32.lib libeay32.lib user32.lib gdi32.lib
10201020
!endif
10211021
10221022
!ifdef FOSSIL_ENABLE_TCL
10231023
TCLDIR = $(B)\compat\tcl-8.6
10241024
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -444,12 +444,12 @@
444 #### The directories where the OpenSSL include and library files are located.
445 # The recommended usage here is to use the Sysinternals junction tool
446 # to create a hard link between an "openssl-1.x" sub-directory of the
447 # Fossil source code directory and the target OpenSSL source directory.
448 #
449 OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1f/include
450 OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1f
451
452 #### Either the directory where the Tcl library is installed or the Tcl
453 # source code directory resides (depending on the value of the macro
454 # FOSSIL_TCL_SOURCE). If this points to the Tcl install directory,
455 # this directory must have "include" and "lib" sub-directories. If
@@ -1012,12 +1012,12 @@
1012
1013 # Uncomment to enable Tcl support
1014 # FOSSIL_ENABLE_TCL = 1
1015
1016 !ifdef FOSSIL_ENABLE_SSL
1017 SSLINCDIR = $(B)\compat\openssl-1.0.1f\include
1018 SSLLIBDIR = $(B)\compat\openssl-1.0.1f\out32
1019 SSLLIB = ssleay32.lib libeay32.lib user32.lib gdi32.lib
1020 !endif
1021
1022 !ifdef FOSSIL_ENABLE_TCL
1023 TCLDIR = $(B)\compat\tcl-8.6
1024
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -444,12 +444,12 @@
444 #### The directories where the OpenSSL include and library files are located.
445 # The recommended usage here is to use the Sysinternals junction tool
446 # to create a hard link between an "openssl-1.x" sub-directory of the
447 # Fossil source code directory and the target OpenSSL source directory.
448 #
449 OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1g/include
450 OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1g
451
452 #### Either the directory where the Tcl library is installed or the Tcl
453 # source code directory resides (depending on the value of the macro
454 # FOSSIL_TCL_SOURCE). If this points to the Tcl install directory,
455 # this directory must have "include" and "lib" sub-directories. If
@@ -1012,12 +1012,12 @@
1012
1013 # Uncomment to enable Tcl support
1014 # FOSSIL_ENABLE_TCL = 1
1015
1016 !ifdef FOSSIL_ENABLE_SSL
1017 SSLINCDIR = $(B)\compat\openssl-1.0.1g\include
1018 SSLLIBDIR = $(B)\compat\openssl-1.0.1g\out32
1019 SSLLIB = ssleay32.lib libeay32.lib user32.lib gdi32.lib
1020 !endif
1021
1022 !ifdef FOSSIL_ENABLE_TCL
1023 TCLDIR = $(B)\compat\tcl-8.6
1024
+28 -34
--- src/manifest.c
+++ src/manifest.c
@@ -135,16 +135,16 @@
135135
** Clear the memory allocated in a manifest object
136136
*/
137137
void manifest_destroy(Manifest *p){
138138
if( p ){
139139
blob_reset(&p->content);
140
- free(p->aFile);
141
- free(p->azParent);
142
- free(p->azCChild);
143
- free(p->aTag);
144
- free(p->aField);
145
- free(p->aCherrypick);
140
+ fossil_free(p->aFile);
141
+ fossil_free(p->azParent);
142
+ fossil_free(p->azCChild);
143
+ fossil_free(p->aTag);
144
+ fossil_free(p->aField);
145
+ fossil_free(p->aCherrypick);
146146
if( p->pBaseline ) manifest_destroy(p->pBaseline);
147147
memset(p, 0, sizeof(*p));
148148
fossil_free(p);
149149
}
150150
}
@@ -1608,11 +1608,11 @@
16081608
blob_appendf(&comment, "Ticket [%s|%.10s] <i>%h</i> status still %h with "
16091609
"%d other change%s",
16101610
pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle, zNewStatus,
16111611
pManifest->nField, pManifest->nField==1 ? "" : "s"
16121612
);
1613
- free(zNewStatus);
1613
+ fossil_free(zNewStatus);
16141614
blob_appendf(&brief, "Ticket [%s|%.10s]: %d change%s",
16151615
pManifest->zTicketUuid, pManifest->zTicketUuid, pManifest->nField,
16161616
pManifest->nField==1 ? "" : "s"
16171617
);
16181618
}
@@ -1621,11 +1621,11 @@
16211621
pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle
16221622
);
16231623
blob_appendf(&brief, "New ticket [%s|%.10s].", pManifest->zTicketUuid,
16241624
pManifest->zTicketUuid);
16251625
}
1626
- free(zTitle);
1626
+ fossil_free(zTitle);
16271627
db_multi_exec(
16281628
"REPLACE INTO event(type,tagid,mtime,objid,user,comment,brief)"
16291629
"VALUES('t',%d,%.17g,%d,%Q,%Q,%Q)",
16301630
tktTagId, pManifest->rDate, rid, pManifest->zUser,
16311631
blob_str(&comment), blob_str(&brief)
@@ -1753,11 +1753,11 @@
17531753
TAG_COMMENT, rid, p->rDate
17541754
);
17551755
zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event"
17561756
" WHERE rowid=last_insert_rowid()");
17571757
wiki_extract_links(zCom, rid, 0, p->rDate, 1, WIKI_INLINE);
1758
- free(zCom);
1758
+ fossil_free(zCom);
17591759
17601760
/* If this is a delta-manifest, record the fact that this repository
17611761
** contains delta manifests, to free the "commit" logic to generate
17621762
** new delta manifests.
17631763
*/
@@ -1822,11 +1822,11 @@
18221822
char zLength[40];
18231823
while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
18241824
nWiki = strlen(p->zWiki);
18251825
sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
18261826
tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
1827
- free(zTag);
1827
+ fossil_free(zTag);
18281828
prior = db_int(0,
18291829
"SELECT rid FROM tagxref"
18301830
" WHERE tagid=%d AND mtime<%.17g"
18311831
" ORDER BY mtime DESC",
18321832
tagid, p->rDate
@@ -1850,11 +1850,11 @@
18501850
TAG_BGCOLOR, rid,
18511851
TAG_BGCOLOR, rid,
18521852
TAG_USER, rid,
18531853
TAG_COMMENT, rid
18541854
);
1855
- free(zComment);
1855
+ fossil_free(zComment);
18561856
}
18571857
if( p->type==CFTYPE_EVENT ){
18581858
char *zTag = mprintf("event-%s", p->zEventId);
18591859
int tagid = tag_findid(zTag, 1);
18601860
int prior, subsequent;
@@ -1862,11 +1862,11 @@
18621862
char zLength[40];
18631863
while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
18641864
nWiki = strlen(p->zWiki);
18651865
sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
18661866
tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
1867
- free(zTag);
1867
+ fossil_free(zTag);
18681868
prior = db_int(0,
18691869
"SELECT rid FROM tagxref"
18701870
" WHERE tagid=%d AND mtime<%.17g AND rid!=%d"
18711871
" ORDER BY mtime DESC",
18721872
tagid, p->rDate, rid
@@ -1901,22 +1901,26 @@
19011901
);
19021902
}
19031903
}
19041904
if( p->type==CFTYPE_TICKET ){
19051905
char *zTag;
1906
-
19071906
assert( manifest_crosslink_busy==1 );
19081907
zTag = mprintf("tkt-%s", p->zTicketUuid);
19091908
tag_insert(zTag, 1, 0, rid, p->rDate, rid);
1910
- free(zTag);
1909
+ fossil_free(zTag);
19111910
db_multi_exec("INSERT OR IGNORE INTO pending_tkt VALUES(%Q)",
19121911
p->zTicketUuid);
19131912
}
19141913
if( p->type==CFTYPE_ATTACHMENT ){
1914
+ char *zComment = 0;
1915
+ char const isAdd = (p->zAttachSrc && p->zAttachSrc[0]) ? 1 : 0;
1916
+ char const attachToType = fossil_is_uuid(p->zAttachTarget)
1917
+ ? 't' /* attach to ticket */
1918
+ : 'w' /* attach to wiki page */;
19151919
db_multi_exec(
19161920
"INSERT INTO attachment(attachid, mtime, src, target,"
1917
- "filename, comment, user)"
1921
+ "filename, comment, user)"
19181922
"VALUES(%d,%.17g,%Q,%Q,%Q,%Q,%Q);",
19191923
rid, p->rDate, p->zAttachSrc, p->zAttachTarget, p->zAttachName,
19201924
(p->zComment ? p->zComment : ""), p->zUser
19211925
);
19221926
db_multi_exec(
@@ -1925,45 +1929,35 @@
19251929
" WHERE target=%Q AND filename=%Q))"
19261930
" WHERE target=%Q AND filename=%Q",
19271931
p->zAttachTarget, p->zAttachName,
19281932
p->zAttachTarget, p->zAttachName
19291933
);
1930
- if( strlen(p->zAttachTarget)!=UUID_SIZE
1931
- || !validate16(p->zAttachTarget, UUID_SIZE)
1932
- ){
1933
- char *zComment;
1934
- if( p->zAttachSrc && p->zAttachSrc[0] ){
1934
+ if( 'w' == attachToType ){
1935
+ if( isAdd ){
19351936
zComment = mprintf(
19361937
"Add attachment [/artifact/%s|%h] to wiki page [%h]",
19371938
p->zAttachSrc, p->zAttachName, p->zAttachTarget);
19381939
}else{
19391940
zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]",
19401941
p->zAttachName, p->zAttachTarget);
19411942
}
1942
- db_multi_exec(
1943
- "REPLACE INTO event(type,mtime,objid,user,comment)"
1944
- "VALUES('w',%.17g,%d,%Q,%Q)",
1945
- p->rDate, rid, p->zUser, zComment
1946
- );
1947
- free(zComment);
19481943
}else{
1949
- char *zComment;
1950
- if( p->zAttachSrc && p->zAttachSrc[0] ){
1944
+ if( isAdd ){
19511945
zComment = mprintf(
19521946
"Add attachment [/artifact/%s|%h] to ticket [%s|%.10s]",
19531947
p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget);
19541948
}else{
19551949
zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%.10s]",
19561950
p->zAttachName, p->zAttachTarget, p->zAttachTarget);
19571951
}
1958
- db_multi_exec(
1952
+ }
1953
+ db_multi_exec(
19591954
"REPLACE INTO event(type,mtime,objid,user,comment)"
1960
- "VALUES('t',%.17g,%d,%Q,%Q)",
1961
- p->rDate, rid, p->zUser, zComment
1962
- );
1963
- free(zComment);
1964
- }
1955
+ "VALUES('%c',%.17g,%d,%Q,%Q)",
1956
+ attachToType, p->rDate, rid, p->zUser, zComment
1957
+ );
1958
+ fossil_free(zComment);
19651959
}
19661960
if( p->type==CFTYPE_CONTROL ){
19671961
Blob comment;
19681962
int i;
19691963
const char *zName;
19701964
--- src/manifest.c
+++ src/manifest.c
@@ -135,16 +135,16 @@
135 ** Clear the memory allocated in a manifest object
136 */
137 void manifest_destroy(Manifest *p){
138 if( p ){
139 blob_reset(&p->content);
140 free(p->aFile);
141 free(p->azParent);
142 free(p->azCChild);
143 free(p->aTag);
144 free(p->aField);
145 free(p->aCherrypick);
146 if( p->pBaseline ) manifest_destroy(p->pBaseline);
147 memset(p, 0, sizeof(*p));
148 fossil_free(p);
149 }
150 }
@@ -1608,11 +1608,11 @@
1608 blob_appendf(&comment, "Ticket [%s|%.10s] <i>%h</i> status still %h with "
1609 "%d other change%s",
1610 pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle, zNewStatus,
1611 pManifest->nField, pManifest->nField==1 ? "" : "s"
1612 );
1613 free(zNewStatus);
1614 blob_appendf(&brief, "Ticket [%s|%.10s]: %d change%s",
1615 pManifest->zTicketUuid, pManifest->zTicketUuid, pManifest->nField,
1616 pManifest->nField==1 ? "" : "s"
1617 );
1618 }
@@ -1621,11 +1621,11 @@
1621 pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle
1622 );
1623 blob_appendf(&brief, "New ticket [%s|%.10s].", pManifest->zTicketUuid,
1624 pManifest->zTicketUuid);
1625 }
1626 free(zTitle);
1627 db_multi_exec(
1628 "REPLACE INTO event(type,tagid,mtime,objid,user,comment,brief)"
1629 "VALUES('t',%d,%.17g,%d,%Q,%Q,%Q)",
1630 tktTagId, pManifest->rDate, rid, pManifest->zUser,
1631 blob_str(&comment), blob_str(&brief)
@@ -1753,11 +1753,11 @@
1753 TAG_COMMENT, rid, p->rDate
1754 );
1755 zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event"
1756 " WHERE rowid=last_insert_rowid()");
1757 wiki_extract_links(zCom, rid, 0, p->rDate, 1, WIKI_INLINE);
1758 free(zCom);
1759
1760 /* If this is a delta-manifest, record the fact that this repository
1761 ** contains delta manifests, to free the "commit" logic to generate
1762 ** new delta manifests.
1763 */
@@ -1822,11 +1822,11 @@
1822 char zLength[40];
1823 while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
1824 nWiki = strlen(p->zWiki);
1825 sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
1826 tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
1827 free(zTag);
1828 prior = db_int(0,
1829 "SELECT rid FROM tagxref"
1830 " WHERE tagid=%d AND mtime<%.17g"
1831 " ORDER BY mtime DESC",
1832 tagid, p->rDate
@@ -1850,11 +1850,11 @@
1850 TAG_BGCOLOR, rid,
1851 TAG_BGCOLOR, rid,
1852 TAG_USER, rid,
1853 TAG_COMMENT, rid
1854 );
1855 free(zComment);
1856 }
1857 if( p->type==CFTYPE_EVENT ){
1858 char *zTag = mprintf("event-%s", p->zEventId);
1859 int tagid = tag_findid(zTag, 1);
1860 int prior, subsequent;
@@ -1862,11 +1862,11 @@
1862 char zLength[40];
1863 while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
1864 nWiki = strlen(p->zWiki);
1865 sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
1866 tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
1867 free(zTag);
1868 prior = db_int(0,
1869 "SELECT rid FROM tagxref"
1870 " WHERE tagid=%d AND mtime<%.17g AND rid!=%d"
1871 " ORDER BY mtime DESC",
1872 tagid, p->rDate, rid
@@ -1901,22 +1901,26 @@
1901 );
1902 }
1903 }
1904 if( p->type==CFTYPE_TICKET ){
1905 char *zTag;
1906
1907 assert( manifest_crosslink_busy==1 );
1908 zTag = mprintf("tkt-%s", p->zTicketUuid);
1909 tag_insert(zTag, 1, 0, rid, p->rDate, rid);
1910 free(zTag);
1911 db_multi_exec("INSERT OR IGNORE INTO pending_tkt VALUES(%Q)",
1912 p->zTicketUuid);
1913 }
1914 if( p->type==CFTYPE_ATTACHMENT ){
 
 
 
 
 
1915 db_multi_exec(
1916 "INSERT INTO attachment(attachid, mtime, src, target,"
1917 "filename, comment, user)"
1918 "VALUES(%d,%.17g,%Q,%Q,%Q,%Q,%Q);",
1919 rid, p->rDate, p->zAttachSrc, p->zAttachTarget, p->zAttachName,
1920 (p->zComment ? p->zComment : ""), p->zUser
1921 );
1922 db_multi_exec(
@@ -1925,45 +1929,35 @@
1925 " WHERE target=%Q AND filename=%Q))"
1926 " WHERE target=%Q AND filename=%Q",
1927 p->zAttachTarget, p->zAttachName,
1928 p->zAttachTarget, p->zAttachName
1929 );
1930 if( strlen(p->zAttachTarget)!=UUID_SIZE
1931 || !validate16(p->zAttachTarget, UUID_SIZE)
1932 ){
1933 char *zComment;
1934 if( p->zAttachSrc && p->zAttachSrc[0] ){
1935 zComment = mprintf(
1936 "Add attachment [/artifact/%s|%h] to wiki page [%h]",
1937 p->zAttachSrc, p->zAttachName, p->zAttachTarget);
1938 }else{
1939 zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]",
1940 p->zAttachName, p->zAttachTarget);
1941 }
1942 db_multi_exec(
1943 "REPLACE INTO event(type,mtime,objid,user,comment)"
1944 "VALUES('w',%.17g,%d,%Q,%Q)",
1945 p->rDate, rid, p->zUser, zComment
1946 );
1947 free(zComment);
1948 }else{
1949 char *zComment;
1950 if( p->zAttachSrc && p->zAttachSrc[0] ){
1951 zComment = mprintf(
1952 "Add attachment [/artifact/%s|%h] to ticket [%s|%.10s]",
1953 p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget);
1954 }else{
1955 zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%.10s]",
1956 p->zAttachName, p->zAttachTarget, p->zAttachTarget);
1957 }
1958 db_multi_exec(
 
1959 "REPLACE INTO event(type,mtime,objid,user,comment)"
1960 "VALUES('t',%.17g,%d,%Q,%Q)",
1961 p->rDate, rid, p->zUser, zComment
1962 );
1963 free(zComment);
1964 }
1965 }
1966 if( p->type==CFTYPE_CONTROL ){
1967 Blob comment;
1968 int i;
1969 const char *zName;
1970
--- src/manifest.c
+++ src/manifest.c
@@ -135,16 +135,16 @@
135 ** Clear the memory allocated in a manifest object
136 */
137 void manifest_destroy(Manifest *p){
138 if( p ){
139 blob_reset(&p->content);
140 fossil_free(p->aFile);
141 fossil_free(p->azParent);
142 fossil_free(p->azCChild);
143 fossil_free(p->aTag);
144 fossil_free(p->aField);
145 fossil_free(p->aCherrypick);
146 if( p->pBaseline ) manifest_destroy(p->pBaseline);
147 memset(p, 0, sizeof(*p));
148 fossil_free(p);
149 }
150 }
@@ -1608,11 +1608,11 @@
1608 blob_appendf(&comment, "Ticket [%s|%.10s] <i>%h</i> status still %h with "
1609 "%d other change%s",
1610 pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle, zNewStatus,
1611 pManifest->nField, pManifest->nField==1 ? "" : "s"
1612 );
1613 fossil_free(zNewStatus);
1614 blob_appendf(&brief, "Ticket [%s|%.10s]: %d change%s",
1615 pManifest->zTicketUuid, pManifest->zTicketUuid, pManifest->nField,
1616 pManifest->nField==1 ? "" : "s"
1617 );
1618 }
@@ -1621,11 +1621,11 @@
1621 pManifest->zTicketUuid, pManifest->zTicketUuid, zTitle
1622 );
1623 blob_appendf(&brief, "New ticket [%s|%.10s].", pManifest->zTicketUuid,
1624 pManifest->zTicketUuid);
1625 }
1626 fossil_free(zTitle);
1627 db_multi_exec(
1628 "REPLACE INTO event(type,tagid,mtime,objid,user,comment,brief)"
1629 "VALUES('t',%d,%.17g,%d,%Q,%Q,%Q)",
1630 tktTagId, pManifest->rDate, rid, pManifest->zUser,
1631 blob_str(&comment), blob_str(&brief)
@@ -1753,11 +1753,11 @@
1753 TAG_COMMENT, rid, p->rDate
1754 );
1755 zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event"
1756 " WHERE rowid=last_insert_rowid()");
1757 wiki_extract_links(zCom, rid, 0, p->rDate, 1, WIKI_INLINE);
1758 fossil_free(zCom);
1759
1760 /* If this is a delta-manifest, record the fact that this repository
1761 ** contains delta manifests, to free the "commit" logic to generate
1762 ** new delta manifests.
1763 */
@@ -1822,11 +1822,11 @@
1822 char zLength[40];
1823 while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
1824 nWiki = strlen(p->zWiki);
1825 sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
1826 tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
1827 fossil_free(zTag);
1828 prior = db_int(0,
1829 "SELECT rid FROM tagxref"
1830 " WHERE tagid=%d AND mtime<%.17g"
1831 " ORDER BY mtime DESC",
1832 tagid, p->rDate
@@ -1850,11 +1850,11 @@
1850 TAG_BGCOLOR, rid,
1851 TAG_BGCOLOR, rid,
1852 TAG_USER, rid,
1853 TAG_COMMENT, rid
1854 );
1855 fossil_free(zComment);
1856 }
1857 if( p->type==CFTYPE_EVENT ){
1858 char *zTag = mprintf("event-%s", p->zEventId);
1859 int tagid = tag_findid(zTag, 1);
1860 int prior, subsequent;
@@ -1862,11 +1862,11 @@
1862 char zLength[40];
1863 while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
1864 nWiki = strlen(p->zWiki);
1865 sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
1866 tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
1867 fossil_free(zTag);
1868 prior = db_int(0,
1869 "SELECT rid FROM tagxref"
1870 " WHERE tagid=%d AND mtime<%.17g AND rid!=%d"
1871 " ORDER BY mtime DESC",
1872 tagid, p->rDate, rid
@@ -1901,22 +1901,26 @@
1901 );
1902 }
1903 }
1904 if( p->type==CFTYPE_TICKET ){
1905 char *zTag;
 
1906 assert( manifest_crosslink_busy==1 );
1907 zTag = mprintf("tkt-%s", p->zTicketUuid);
1908 tag_insert(zTag, 1, 0, rid, p->rDate, rid);
1909 fossil_free(zTag);
1910 db_multi_exec("INSERT OR IGNORE INTO pending_tkt VALUES(%Q)",
1911 p->zTicketUuid);
1912 }
1913 if( p->type==CFTYPE_ATTACHMENT ){
1914 char *zComment = 0;
1915 char const isAdd = (p->zAttachSrc && p->zAttachSrc[0]) ? 1 : 0;
1916 char const attachToType = fossil_is_uuid(p->zAttachTarget)
1917 ? 't' /* attach to ticket */
1918 : 'w' /* attach to wiki page */;
1919 db_multi_exec(
1920 "INSERT INTO attachment(attachid, mtime, src, target,"
1921 "filename, comment, user)"
1922 "VALUES(%d,%.17g,%Q,%Q,%Q,%Q,%Q);",
1923 rid, p->rDate, p->zAttachSrc, p->zAttachTarget, p->zAttachName,
1924 (p->zComment ? p->zComment : ""), p->zUser
1925 );
1926 db_multi_exec(
@@ -1925,45 +1929,35 @@
1929 " WHERE target=%Q AND filename=%Q))"
1930 " WHERE target=%Q AND filename=%Q",
1931 p->zAttachTarget, p->zAttachName,
1932 p->zAttachTarget, p->zAttachName
1933 );
1934 if( 'w' == attachToType ){
1935 if( isAdd ){
 
 
 
1936 zComment = mprintf(
1937 "Add attachment [/artifact/%s|%h] to wiki page [%h]",
1938 p->zAttachSrc, p->zAttachName, p->zAttachTarget);
1939 }else{
1940 zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]",
1941 p->zAttachName, p->zAttachTarget);
1942 }
 
 
 
 
 
 
1943 }else{
1944 if( isAdd ){
 
1945 zComment = mprintf(
1946 "Add attachment [/artifact/%s|%h] to ticket [%s|%.10s]",
1947 p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget);
1948 }else{
1949 zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%.10s]",
1950 p->zAttachName, p->zAttachTarget, p->zAttachTarget);
1951 }
1952 }
1953 db_multi_exec(
1954 "REPLACE INTO event(type,mtime,objid,user,comment)"
1955 "VALUES('%c',%.17g,%d,%Q,%Q)",
1956 attachToType, p->rDate, rid, p->zUser, zComment
1957 );
1958 fossil_free(zComment);
 
1959 }
1960 if( p->type==CFTYPE_CONTROL ){
1961 Blob comment;
1962 int i;
1963 const char *zName;
1964
+2 -4
--- src/th.c
+++ src/th.c
@@ -2639,17 +2639,15 @@
26392639
if( z[i]=='0' ){
26402640
if( z[i+1]=='x' || z[i+1]=='X' ){
26412641
i += 2;
26422642
base = 16;
26432643
isdigit = th_ishexdig;
2644
- }
2645
- if( z[i+1]=='o' || z[i+1]=='O' ){
2644
+ }else if( z[i+1]=='o' || z[i+1]=='O' ){
26462645
i += 2;
26472646
base = 8;
26482647
isdigit = th_isoctdig;
2649
- }
2650
- if( z[i+1]=='b' || z[i+1]=='B' ){
2648
+ }else if( z[i+1]=='b' || z[i+1]=='B' ){
26512649
i += 2;
26522650
base = 2;
26532651
isdigit = th_isbindig;
26542652
}
26552653
}
26562654
--- src/th.c
+++ src/th.c
@@ -2639,17 +2639,15 @@
2639 if( z[i]=='0' ){
2640 if( z[i+1]=='x' || z[i+1]=='X' ){
2641 i += 2;
2642 base = 16;
2643 isdigit = th_ishexdig;
2644 }
2645 if( z[i+1]=='o' || z[i+1]=='O' ){
2646 i += 2;
2647 base = 8;
2648 isdigit = th_isoctdig;
2649 }
2650 if( z[i+1]=='b' || z[i+1]=='B' ){
2651 i += 2;
2652 base = 2;
2653 isdigit = th_isbindig;
2654 }
2655 }
2656
--- src/th.c
+++ src/th.c
@@ -2639,17 +2639,15 @@
2639 if( z[i]=='0' ){
2640 if( z[i+1]=='x' || z[i+1]=='X' ){
2641 i += 2;
2642 base = 16;
2643 isdigit = th_ishexdig;
2644 }else if( z[i+1]=='o' || z[i+1]=='O' ){
 
2645 i += 2;
2646 base = 8;
2647 isdigit = th_isoctdig;
2648 }else if( z[i+1]=='b' || z[i+1]=='B' ){
 
2649 i += 2;
2650 base = 2;
2651 isdigit = th_isbindig;
2652 }
2653 }
2654
+12 -19
--- src/tkt.c
+++ src/tkt.c
@@ -446,14 +446,14 @@
446446
style_submenu_element("Attach", "Add An Attachment",
447447
"%s/attachadd?tkt=%T&from=%s/tktview/%t",
448448
g.zTop, zUuid, g.zTop, zUuid);
449449
}
450450
if( P("plaintext") ){
451
- style_submenu_element("Formatted", "Formatted", "%R/tktview/%S", zUuid);
451
+ style_submenu_element("Formatted", "Formatted", "%R/tktview/%s", zUuid);
452452
}else{
453453
style_submenu_element("Plaintext", "Plaintext",
454
- "%R/tktview/%S?plaintext", zUuid);
454
+ "%R/tktview/%s?plaintext", zUuid);
455455
}
456456
style_header("View Ticket");
457457
if( g.thTrace ) Th_Trace("BEGIN_TKTVIEW<br />\n", -1);
458458
ticket_init();
459459
initializeVariablesFromCGI();
@@ -895,14 +895,14 @@
895895
"%s/tkttimeline?name=%s&y=ci", g.zTop, zUuid);
896896
style_submenu_element("Timeline", "Timeline",
897897
"%s/tkttimeline?name=%s", g.zTop, zUuid);
898898
if( P("plaintext")!=0 ){
899899
style_submenu_element("Formatted", "Formatted",
900
- "%R/tkthistory/%S", zUuid);
900
+ "%R/tkthistory/%s", zUuid);
901901
}else{
902902
style_submenu_element("Plaintext", "Plaintext",
903
- "%R/tkthistory/%S?plaintext", zUuid);
903
+ "%R/tkthistory/%s?plaintext", zUuid);
904904
}
905905
style_header(zTitle);
906906
free(zTitle);
907907
908908
tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",zUuid);
@@ -924,17 +924,14 @@
924924
" ORDER BY 1",
925925
timeline_utc(), tagid, timeline_utc(), tagid
926926
);
927927
while( db_step(&q)==SQLITE_ROW ){
928928
Manifest *pTicket;
929
- char zShort[12];
930929
const char *zDate = db_column_text(&q, 0);
931930
int rid = db_column_int(&q, 1);
932931
const char *zChngUuid = db_column_text(&q, 2);
933932
const char *zFile = db_column_text(&q, 4);
934
- memcpy(zShort, zChngUuid, 10);
935
- zShort[10] = 0;
936933
if( nChng==0 ){
937934
@ <ol>
938935
}
939936
nChng++;
940937
if( zFile!=0 ){
@@ -944,22 +941,22 @@
944941
@
945942
@ <li><p>Delete attachment "%h(zFile)"
946943
}else{
947944
@
948945
@ <li><p>Add attachment
949
- @ "%z(href("%R/artifact/%S",zSrc))%s(zFile)</a>"
946
+ @ "%z(href("%R/artifact/%s",zSrc))%s(zFile)</a>"
950947
}
951
- @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>]
948
+ @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>]
952949
@ (rid %d(rid)) by
953950
hyperlink_to_user(zUser,zDate," on");
954951
hyperlink_to_date(zDate, ".</p>");
955952
}else{
956953
pTicket = manifest_get(rid, CFTYPE_TICKET, 0);
957954
if( pTicket ){
958955
@
959956
@ <li><p>Ticket change
960
- @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>]
957
+ @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>]
961958
@ (rid %d(rid)) by
962959
hyperlink_to_user(pTicket->zUser,zDate," on");
963960
hyperlink_to_date(zDate, ":");
964961
@ </p>
965962
ticket_output_change_artifact(pTicket, "a");
@@ -1219,35 +1216,31 @@
12191216
zTktUuid);
12201217
if( tagid==0 ){
12211218
fossil_fatal("no such ticket %h", zTktUuid);
12221219
}
12231220
db_prepare(&q,
1224
- "SELECT datetime(mtime%s), objid, uuid, NULL, NULL, NULL"
1221
+ "SELECT datetime(mtime%s), objid, NULL, NULL, NULL"
12251222
" FROM event, blob"
12261223
" WHERE objid IN (SELECT rid FROM tagxref WHERE tagid=%d)"
12271224
" AND blob.rid=event.objid"
12281225
" UNION "
1229
- "SELECT datetime(mtime%s), attachid, uuid, src, "
1230
- " filename, user"
1226
+ "SELECT datetime(mtime%s), attachid, filename, "
1227
+ " src, user"
12311228
" FROM attachment, blob"
12321229
" WHERE target=(SELECT substr(tagname,5) FROM tag WHERE tagid=%d)"
12331230
" AND blob.rid=attachid"
12341231
" ORDER BY 1 DESC",
12351232
timeline_utc(), tagid, timeline_utc(), tagid
12361233
);
12371234
while( db_step(&q)==SQLITE_ROW ){
12381235
Manifest *pTicket;
1239
- char zShort[12];
12401236
const char *zDate = db_column_text(&q, 0);
12411237
int rid = db_column_int(&q, 1);
1242
- const char *zChngUuid = db_column_text(&q, 2);
1243
- const char *zFile = db_column_text(&q, 4);
1244
- memcpy(zShort, zChngUuid, 10);
1245
- zShort[10] = 0;
1238
+ const char *zFile = db_column_text(&q, 2);
12461239
if( zFile!=0 ){
12471240
const char *zSrc = db_column_text(&q, 3);
1248
- const char *zUser = db_column_text(&q, 5);
1241
+ const char *zUser = db_column_text(&q, 4);
12491242
if( zSrc==0 || zSrc[0]==0 ){
12501243
fossil_print("Delete attachment %s\n", zFile);
12511244
}else{
12521245
fossil_print("Add attachment %s\n", zFile);
12531246
}
12541247
--- src/tkt.c
+++ src/tkt.c
@@ -446,14 +446,14 @@
446 style_submenu_element("Attach", "Add An Attachment",
447 "%s/attachadd?tkt=%T&from=%s/tktview/%t",
448 g.zTop, zUuid, g.zTop, zUuid);
449 }
450 if( P("plaintext") ){
451 style_submenu_element("Formatted", "Formatted", "%R/tktview/%S", zUuid);
452 }else{
453 style_submenu_element("Plaintext", "Plaintext",
454 "%R/tktview/%S?plaintext", zUuid);
455 }
456 style_header("View Ticket");
457 if( g.thTrace ) Th_Trace("BEGIN_TKTVIEW<br />\n", -1);
458 ticket_init();
459 initializeVariablesFromCGI();
@@ -895,14 +895,14 @@
895 "%s/tkttimeline?name=%s&y=ci", g.zTop, zUuid);
896 style_submenu_element("Timeline", "Timeline",
897 "%s/tkttimeline?name=%s", g.zTop, zUuid);
898 if( P("plaintext")!=0 ){
899 style_submenu_element("Formatted", "Formatted",
900 "%R/tkthistory/%S", zUuid);
901 }else{
902 style_submenu_element("Plaintext", "Plaintext",
903 "%R/tkthistory/%S?plaintext", zUuid);
904 }
905 style_header(zTitle);
906 free(zTitle);
907
908 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",zUuid);
@@ -924,17 +924,14 @@
924 " ORDER BY 1",
925 timeline_utc(), tagid, timeline_utc(), tagid
926 );
927 while( db_step(&q)==SQLITE_ROW ){
928 Manifest *pTicket;
929 char zShort[12];
930 const char *zDate = db_column_text(&q, 0);
931 int rid = db_column_int(&q, 1);
932 const char *zChngUuid = db_column_text(&q, 2);
933 const char *zFile = db_column_text(&q, 4);
934 memcpy(zShort, zChngUuid, 10);
935 zShort[10] = 0;
936 if( nChng==0 ){
937 @ <ol>
938 }
939 nChng++;
940 if( zFile!=0 ){
@@ -944,22 +941,22 @@
944 @
945 @ <li><p>Delete attachment "%h(zFile)"
946 }else{
947 @
948 @ <li><p>Add attachment
949 @ "%z(href("%R/artifact/%S",zSrc))%s(zFile)</a>"
950 }
951 @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>]
952 @ (rid %d(rid)) by
953 hyperlink_to_user(zUser,zDate," on");
954 hyperlink_to_date(zDate, ".</p>");
955 }else{
956 pTicket = manifest_get(rid, CFTYPE_TICKET, 0);
957 if( pTicket ){
958 @
959 @ <li><p>Ticket change
960 @ [%z(href("%R/artifact/%T",zChngUuid))%s(zShort)</a>]
961 @ (rid %d(rid)) by
962 hyperlink_to_user(pTicket->zUser,zDate," on");
963 hyperlink_to_date(zDate, ":");
964 @ </p>
965 ticket_output_change_artifact(pTicket, "a");
@@ -1219,35 +1216,31 @@
1219 zTktUuid);
1220 if( tagid==0 ){
1221 fossil_fatal("no such ticket %h", zTktUuid);
1222 }
1223 db_prepare(&q,
1224 "SELECT datetime(mtime%s), objid, uuid, NULL, NULL, NULL"
1225 " FROM event, blob"
1226 " WHERE objid IN (SELECT rid FROM tagxref WHERE tagid=%d)"
1227 " AND blob.rid=event.objid"
1228 " UNION "
1229 "SELECT datetime(mtime%s), attachid, uuid, src, "
1230 " filename, user"
1231 " FROM attachment, blob"
1232 " WHERE target=(SELECT substr(tagname,5) FROM tag WHERE tagid=%d)"
1233 " AND blob.rid=attachid"
1234 " ORDER BY 1 DESC",
1235 timeline_utc(), tagid, timeline_utc(), tagid
1236 );
1237 while( db_step(&q)==SQLITE_ROW ){
1238 Manifest *pTicket;
1239 char zShort[12];
1240 const char *zDate = db_column_text(&q, 0);
1241 int rid = db_column_int(&q, 1);
1242 const char *zChngUuid = db_column_text(&q, 2);
1243 const char *zFile = db_column_text(&q, 4);
1244 memcpy(zShort, zChngUuid, 10);
1245 zShort[10] = 0;
1246 if( zFile!=0 ){
1247 const char *zSrc = db_column_text(&q, 3);
1248 const char *zUser = db_column_text(&q, 5);
1249 if( zSrc==0 || zSrc[0]==0 ){
1250 fossil_print("Delete attachment %s\n", zFile);
1251 }else{
1252 fossil_print("Add attachment %s\n", zFile);
1253 }
1254
--- src/tkt.c
+++ src/tkt.c
@@ -446,14 +446,14 @@
446 style_submenu_element("Attach", "Add An Attachment",
447 "%s/attachadd?tkt=%T&from=%s/tktview/%t",
448 g.zTop, zUuid, g.zTop, zUuid);
449 }
450 if( P("plaintext") ){
451 style_submenu_element("Formatted", "Formatted", "%R/tktview/%s", zUuid);
452 }else{
453 style_submenu_element("Plaintext", "Plaintext",
454 "%R/tktview/%s?plaintext", zUuid);
455 }
456 style_header("View Ticket");
457 if( g.thTrace ) Th_Trace("BEGIN_TKTVIEW<br />\n", -1);
458 ticket_init();
459 initializeVariablesFromCGI();
@@ -895,14 +895,14 @@
895 "%s/tkttimeline?name=%s&y=ci", g.zTop, zUuid);
896 style_submenu_element("Timeline", "Timeline",
897 "%s/tkttimeline?name=%s", g.zTop, zUuid);
898 if( P("plaintext")!=0 ){
899 style_submenu_element("Formatted", "Formatted",
900 "%R/tkthistory/%s", zUuid);
901 }else{
902 style_submenu_element("Plaintext", "Plaintext",
903 "%R/tkthistory/%s?plaintext", zUuid);
904 }
905 style_header(zTitle);
906 free(zTitle);
907
908 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",zUuid);
@@ -924,17 +924,14 @@
924 " ORDER BY 1",
925 timeline_utc(), tagid, timeline_utc(), tagid
926 );
927 while( db_step(&q)==SQLITE_ROW ){
928 Manifest *pTicket;
 
929 const char *zDate = db_column_text(&q, 0);
930 int rid = db_column_int(&q, 1);
931 const char *zChngUuid = db_column_text(&q, 2);
932 const char *zFile = db_column_text(&q, 4);
 
 
933 if( nChng==0 ){
934 @ <ol>
935 }
936 nChng++;
937 if( zFile!=0 ){
@@ -944,22 +941,22 @@
941 @
942 @ <li><p>Delete attachment "%h(zFile)"
943 }else{
944 @
945 @ <li><p>Add attachment
946 @ "%z(href("%R/artifact/%s",zSrc))%s(zFile)</a>"
947 }
948 @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>]
949 @ (rid %d(rid)) by
950 hyperlink_to_user(zUser,zDate," on");
951 hyperlink_to_date(zDate, ".</p>");
952 }else{
953 pTicket = manifest_get(rid, CFTYPE_TICKET, 0);
954 if( pTicket ){
955 @
956 @ <li><p>Ticket change
957 @ [%z(href("%R/artifact/%s",zChngUuid))%.10s(zChngUuid)</a>]
958 @ (rid %d(rid)) by
959 hyperlink_to_user(pTicket->zUser,zDate," on");
960 hyperlink_to_date(zDate, ":");
961 @ </p>
962 ticket_output_change_artifact(pTicket, "a");
@@ -1219,35 +1216,31 @@
1216 zTktUuid);
1217 if( tagid==0 ){
1218 fossil_fatal("no such ticket %h", zTktUuid);
1219 }
1220 db_prepare(&q,
1221 "SELECT datetime(mtime%s), objid, NULL, NULL, NULL"
1222 " FROM event, blob"
1223 " WHERE objid IN (SELECT rid FROM tagxref WHERE tagid=%d)"
1224 " AND blob.rid=event.objid"
1225 " UNION "
1226 "SELECT datetime(mtime%s), attachid, filename, "
1227 " src, user"
1228 " FROM attachment, blob"
1229 " WHERE target=(SELECT substr(tagname,5) FROM tag WHERE tagid=%d)"
1230 " AND blob.rid=attachid"
1231 " ORDER BY 1 DESC",
1232 timeline_utc(), tagid, timeline_utc(), tagid
1233 );
1234 while( db_step(&q)==SQLITE_ROW ){
1235 Manifest *pTicket;
 
1236 const char *zDate = db_column_text(&q, 0);
1237 int rid = db_column_int(&q, 1);
1238 const char *zFile = db_column_text(&q, 2);
 
 
 
1239 if( zFile!=0 ){
1240 const char *zSrc = db_column_text(&q, 3);
1241 const char *zUser = db_column_text(&q, 4);
1242 if( zSrc==0 || zSrc[0]==0 ){
1243 fossil_print("Delete attachment %s\n", zFile);
1244 }else{
1245 fossil_print("Add attachment %s\n", zFile);
1246 }
1247
+10
--- src/util.c
+++ src/util.c
@@ -312,5 +312,15 @@
312312
return 1;
313313
#else
314314
return fcntl(fd, F_GETFL)!=(-1) || errno!=EBADF;
315315
#endif
316316
}
317
+
318
+/*
319
+** Returns TRUE if zSym is exactly UUID_SIZE bytes long and contains
320
+** only lower-case ASCII hexadecimal values.
321
+*/
322
+int fossil_is_uuid(char const * zSym){
323
+ return zSym
324
+ && (UUID_SIZE==strlen(zSym))
325
+ && validate16(zSym, UUID_SIZE);
326
+}
317327
--- src/util.c
+++ src/util.c
@@ -312,5 +312,15 @@
312 return 1;
313 #else
314 return fcntl(fd, F_GETFL)!=(-1) || errno!=EBADF;
315 #endif
316 }
 
 
 
 
 
 
 
 
 
 
317
--- src/util.c
+++ src/util.c
@@ -312,5 +312,15 @@
312 return 1;
313 #else
314 return fcntl(fd, F_GETFL)!=(-1) || errno!=EBADF;
315 #endif
316 }
317
318 /*
319 ** Returns TRUE if zSym is exactly UUID_SIZE bytes long and contains
320 ** only lower-case ASCII hexadecimal values.
321 */
322 int fossil_is_uuid(char const * zSym){
323 return zSym
324 && (UUID_SIZE==strlen(zSym))
325 && validate16(zSym, UUID_SIZE);
326 }
327
+1 -1
--- src/wiki.c
+++ src/wiki.c
@@ -241,11 +241,11 @@
241241
if( rid ){
242242
style_submenu_element("Diff", "Last change",
243243
"%R/wdiff?name=%T&a=%d", zPageName, rid);
244244
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
245245
style_submenu_element("Details", "Details",
246
- "%R/info/%S", zUuid);
246
+ "%R/info/%s", zUuid);
247247
}
248248
if( (rid && g.perm.WrWiki) || (!rid && g.perm.NewWiki) ){
249249
if( db_get_boolean("wysiwyg-wiki", 0) ){
250250
style_submenu_element("Edit", "Edit Wiki Page",
251251
"%s/wikiedit?name=%T&wysiwyg=1",
252252
--- src/wiki.c
+++ src/wiki.c
@@ -241,11 +241,11 @@
241 if( rid ){
242 style_submenu_element("Diff", "Last change",
243 "%R/wdiff?name=%T&a=%d", zPageName, rid);
244 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
245 style_submenu_element("Details", "Details",
246 "%R/info/%S", zUuid);
247 }
248 if( (rid && g.perm.WrWiki) || (!rid && g.perm.NewWiki) ){
249 if( db_get_boolean("wysiwyg-wiki", 0) ){
250 style_submenu_element("Edit", "Edit Wiki Page",
251 "%s/wikiedit?name=%T&wysiwyg=1",
252
--- src/wiki.c
+++ src/wiki.c
@@ -241,11 +241,11 @@
241 if( rid ){
242 style_submenu_element("Diff", "Last change",
243 "%R/wdiff?name=%T&a=%d", zPageName, rid);
244 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
245 style_submenu_element("Details", "Details",
246 "%R/info/%s", zUuid);
247 }
248 if( (rid && g.perm.WrWiki) || (!rid && g.perm.NewWiki) ){
249 if( db_get_boolean("wysiwyg-wiki", 0) ){
250 style_submenu_element("Edit", "Edit Wiki Page",
251 "%s/wikiedit?name=%T&wysiwyg=1",
252
--- test/file1.test
+++ test/file1.test
@@ -24,10 +24,19 @@
2424
fossil test-simplify-name $path
2525
test simplify-name-$testname.$i {$::RESULT=="\[$path\] -> \[$result\]"}
2626
incr i
2727
}
2828
}
29
+
30
+proc relative-name {testname args} {
31
+ set i 1
32
+ foreach {subdir path result} $args {
33
+ fossil test-relative-name --chdir $subdir $path
34
+ test relative-name-$testname.$i {$::RESULT==$result}
35
+ incr i
36
+ }
37
+}
2938
3039
simplify-name 100 . . .// . .. .. ..///// ..
3140
simplify-name 101 {} {} / / ///////// / ././././ .
3241
simplify-name 102 x x /x /x ///x //x
3342
simplify-name 103 a/b a/b /a/b /a/b a///b a/b ///a///b///// //a/b
@@ -38,5 +47,16 @@
3847
3948
if {$::tcl_platform(os)=="Windows NT"} {
4049
simplify-name 108 //?/a:/a/b a:/a/b //?/UNC/a/b //a/b //?/ {}
4150
simplify-name 109 \\\\?\\a:\\a\\b a:/a/b \\\\?\\UNC\\a\\b //a/b \\\\?\\ {}
4251
}
52
+
53
+# Those directories are only needed for the testcase being able to "--chdir" to it.
54
+file mkdir test1
55
+file mkdir test1/test2
56
+
57
+relative-name 100 . . . test1 [pwd] .. test1 [pwd]/ .. test1 [pwd]/test ../test
58
+relative-name 101 test1/test2 [pwd] ../.. test1/test2 [pwd]/ ../.. test1/test2 [pwd]/test ../../test
59
+relative-name 102 test1 [pwd]/test ../test . [pwd]/file1 ./file1 . [pwd]/file1/file2 ./file1/file2
60
+
61
+catch {file delete test1/test2}
62
+catch {file delete test1}
4363
--- test/file1.test
+++ test/file1.test
@@ -24,10 +24,19 @@
24 fossil test-simplify-name $path
25 test simplify-name-$testname.$i {$::RESULT=="\[$path\] -> \[$result\]"}
26 incr i
27 }
28 }
 
 
 
 
 
 
 
 
 
29
30 simplify-name 100 . . .// . .. .. ..///// ..
31 simplify-name 101 {} {} / / ///////// / ././././ .
32 simplify-name 102 x x /x /x ///x //x
33 simplify-name 103 a/b a/b /a/b /a/b a///b a/b ///a///b///// //a/b
@@ -38,5 +47,16 @@
38
39 if {$::tcl_platform(os)=="Windows NT"} {
40 simplify-name 108 //?/a:/a/b a:/a/b //?/UNC/a/b //a/b //?/ {}
41 simplify-name 109 \\\\?\\a:\\a\\b a:/a/b \\\\?\\UNC\\a\\b //a/b \\\\?\\ {}
42 }
 
 
 
 
 
 
 
 
 
 
 
43
--- test/file1.test
+++ test/file1.test
@@ -24,10 +24,19 @@
24 fossil test-simplify-name $path
25 test simplify-name-$testname.$i {$::RESULT=="\[$path\] -> \[$result\]"}
26 incr i
27 }
28 }
29
30 proc relative-name {testname args} {
31 set i 1
32 foreach {subdir path result} $args {
33 fossil test-relative-name --chdir $subdir $path
34 test relative-name-$testname.$i {$::RESULT==$result}
35 incr i
36 }
37 }
38
39 simplify-name 100 . . .// . .. .. ..///// ..
40 simplify-name 101 {} {} / / ///////// / ././././ .
41 simplify-name 102 x x /x /x ///x //x
42 simplify-name 103 a/b a/b /a/b /a/b a///b a/b ///a///b///// //a/b
@@ -38,5 +47,16 @@
47
48 if {$::tcl_platform(os)=="Windows NT"} {
49 simplify-name 108 //?/a:/a/b a:/a/b //?/UNC/a/b //a/b //?/ {}
50 simplify-name 109 \\\\?\\a:\\a\\b a:/a/b \\\\?\\UNC\\a\\b //a/b \\\\?\\ {}
51 }
52
53 # Those directories are only needed for the testcase being able to "--chdir" to it.
54 file mkdir test1
55 file mkdir test1/test2
56
57 relative-name 100 . . . test1 [pwd] .. test1 [pwd]/ .. test1 [pwd]/test ../test
58 relative-name 101 test1/test2 [pwd] ../.. test1/test2 [pwd]/ ../.. test1/test2 [pwd]/test ../../test
59 relative-name 102 test1 [pwd]/test ../test . [pwd]/file1 ./file1 . [pwd]/file1/file2 ./file1/file2
60
61 catch {file delete test1/test2}
62 catch {file delete test1}
63
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -84,12 +84,12 @@
8484
#### The directories where the OpenSSL include and library files are located.
8585
# The recommended usage here is to use the Sysinternals junction tool
8686
# to create a hard link between an "openssl-1.x" sub-directory of the
8787
# Fossil source code directory and the target OpenSSL source directory.
8888
#
89
-OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1f/include
90
-OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1f
89
+OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1g/include
90
+OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1g
9191
9292
#### Either the directory where the Tcl library is installed or the Tcl
9393
# source code directory resides (depending on the value of the macro
9494
# FOSSIL_TCL_SOURCE). If this points to the Tcl install directory,
9595
# this directory must have "include" and "lib" sub-directories. If
9696
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -84,12 +84,12 @@
84 #### The directories where the OpenSSL include and library files are located.
85 # The recommended usage here is to use the Sysinternals junction tool
86 # to create a hard link between an "openssl-1.x" sub-directory of the
87 # Fossil source code directory and the target OpenSSL source directory.
88 #
89 OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1f/include
90 OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1f
91
92 #### Either the directory where the Tcl library is installed or the Tcl
93 # source code directory resides (depending on the value of the macro
94 # FOSSIL_TCL_SOURCE). If this points to the Tcl install directory,
95 # this directory must have "include" and "lib" sub-directories. If
96
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -84,12 +84,12 @@
84 #### The directories where the OpenSSL include and library files are located.
85 # The recommended usage here is to use the Sysinternals junction tool
86 # to create a hard link between an "openssl-1.x" sub-directory of the
87 # Fossil source code directory and the target OpenSSL source directory.
88 #
89 OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1g/include
90 OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1g
91
92 #### Either the directory where the Tcl library is installed or the Tcl
93 # source code directory resides (depending on the value of the macro
94 # FOSSIL_TCL_SOURCE). If this points to the Tcl install directory,
95 # this directory must have "include" and "lib" sub-directories. If
96
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -84,12 +84,12 @@
8484
#### The directories where the OpenSSL include and library files are located.
8585
# The recommended usage here is to use the Sysinternals junction tool
8686
# to create a hard link between an "openssl-1.x" sub-directory of the
8787
# Fossil source code directory and the target OpenSSL source directory.
8888
#
89
-OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1f/include
90
-OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1f
89
+OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1g/include
90
+OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1g
9191
9292
#### Either the directory where the Tcl library is installed or the Tcl
9393
# source code directory resides (depending on the value of the macro
9494
# FOSSIL_TCL_SOURCE). If this points to the Tcl install directory,
9595
# this directory must have "include" and "lib" sub-directories. If
9696
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -84,12 +84,12 @@
84 #### The directories where the OpenSSL include and library files are located.
85 # The recommended usage here is to use the Sysinternals junction tool
86 # to create a hard link between an "openssl-1.x" sub-directory of the
87 # Fossil source code directory and the target OpenSSL source directory.
88 #
89 OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1f/include
90 OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1f
91
92 #### Either the directory where the Tcl library is installed or the Tcl
93 # source code directory resides (depending on the value of the macro
94 # FOSSIL_TCL_SOURCE). If this points to the Tcl install directory,
95 # this directory must have "include" and "lib" sub-directories. If
96
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -84,12 +84,12 @@
84 #### The directories where the OpenSSL include and library files are located.
85 # The recommended usage here is to use the Sysinternals junction tool
86 # to create a hard link between an "openssl-1.x" sub-directory of the
87 # Fossil source code directory and the target OpenSSL source directory.
88 #
89 OPENSSLINCDIR = $(SRCDIR)/../compat/openssl-1.0.1g/include
90 OPENSSLLIBDIR = $(SRCDIR)/../compat/openssl-1.0.1g
91
92 #### Either the directory where the Tcl library is installed or the Tcl
93 # source code directory resides (depending on the value of the macro
94 # FOSSIL_TCL_SOURCE). If this points to the Tcl install directory,
95 # this directory must have "include" and "lib" sub-directories. If
96
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -26,12 +26,12 @@
2626
2727
# Uncomment to enable Tcl support
2828
# FOSSIL_ENABLE_TCL = 1
2929
3030
!ifdef FOSSIL_ENABLE_SSL
31
-SSLINCDIR = $(B)\compat\openssl-1.0.1f\include
32
-SSLLIBDIR = $(B)\compat\openssl-1.0.1f\out32
31
+SSLINCDIR = $(B)\compat\openssl-1.0.1g\include
32
+SSLLIBDIR = $(B)\compat\openssl-1.0.1g\out32
3333
SSLLIB = ssleay32.lib libeay32.lib user32.lib gdi32.lib
3434
!endif
3535
3636
!ifdef FOSSIL_ENABLE_TCL
3737
TCLDIR = $(B)\compat\tcl-8.6
3838
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -26,12 +26,12 @@
26
27 # Uncomment to enable Tcl support
28 # FOSSIL_ENABLE_TCL = 1
29
30 !ifdef FOSSIL_ENABLE_SSL
31 SSLINCDIR = $(B)\compat\openssl-1.0.1f\include
32 SSLLIBDIR = $(B)\compat\openssl-1.0.1f\out32
33 SSLLIB = ssleay32.lib libeay32.lib user32.lib gdi32.lib
34 !endif
35
36 !ifdef FOSSIL_ENABLE_TCL
37 TCLDIR = $(B)\compat\tcl-8.6
38
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -26,12 +26,12 @@
26
27 # Uncomment to enable Tcl support
28 # FOSSIL_ENABLE_TCL = 1
29
30 !ifdef FOSSIL_ENABLE_SSL
31 SSLINCDIR = $(B)\compat\openssl-1.0.1g\include
32 SSLLIBDIR = $(B)\compat\openssl-1.0.1g\out32
33 SSLLIB = ssleay32.lib libeay32.lib user32.lib gdi32.lib
34 !endif
35
36 !ifdef FOSSIL_ENABLE_TCL
37 TCLDIR = $(B)\compat\tcl-8.6
38

Keyboard Shortcuts

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