Fossil SCM
Faster and more accurate method for computing file-age. Also add the showid query parameter to /fileage and extend showid on /timeline to show the RIDs for individual files when the "v" query parameter is used.
Commit
dd51f09a390e556968d2e6871e338af55b2bd24d
Parent
c94efdf287eb969…
2 files changed
+24
-23
+11
-5
+24
-23
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -885,38 +885,33 @@ | ||
| 885 | 885 | @ mid INTEGER, |
| 886 | 886 | @ mtime DATETIME, |
| 887 | 887 | @ pathname TEXT |
| 888 | 888 | @ ); |
| 889 | 889 | @ CREATE VIRTUAL TABLE IF NOT EXISTS temp.foci USING files_of_checkin; |
| 890 | -@ CREATE TEMP TABLE descendents(x INTEGER PRIMARY KEY); | |
| 891 | 890 | ; |
| 892 | 891 | |
| 893 | -static const char zComputeFileAgeRun1[] = | |
| 892 | +static const char zComputeFileAgeRun[] = | |
| 894 | 893 | @ WITH RECURSIVE |
| 895 | 894 | @ ckin(x,m) AS (SELECT objid, mtime FROM event WHERE objid=:ckin |
| 896 | 895 | @ UNION |
| 897 | 896 | @ SELECT plink.pid, event.mtime |
| 898 | 897 | @ FROM ckin, plink, event |
| 899 | 898 | @ WHERE plink.cid=ckin.x AND event.objid=plink.pid |
| 900 | 899 | @ ORDER BY 2 DESC) |
| 901 | -@ INSERT INTO descendents SELECT x FROM ckin; | |
| 902 | -; | |
| 903 | -static const char zComputeFileAgeRun2[] = | |
| 904 | 900 | @ INSERT OR IGNORE INTO fileage(fnid, fid, mid, mtime, pathname) |
| 905 | -@ SELECT mlink.fnid, mlink.fid, x, event.mtime, filename.name | |
| 906 | -@ FROM descendents, mlink, event, filename | |
| 907 | -@ WHERE mlink.mid=descendents.x | |
| 908 | -@ AND mlink.fnid IN (SELECT fnid FROM foci, filename | |
| 909 | -@ WHERE foci.checkinID=:ckin | |
| 910 | -@ AND filename.name=foci.filename | |
| 911 | -@ AND filename.name GLOB :glob) | |
| 912 | -@ AND filename.fnid=mlink.fnid | |
| 913 | -@ AND event.objid=mlink.mid | |
| 901 | +@ SELECT filename.fnid, mlink.fid, mlink.mid, event.mtime, filename.name | |
| 902 | +@ FROM foci, filename, blob, mlink, event | |
| 903 | +@ WHERE foci.checkinID=:ckin | |
| 904 | +@ AND foci.filename GLOB :glob | |
| 905 | +@ AND filename.name=foci.filename | |
| 906 | +@ AND blob.uuid=foci.uuid | |
| 907 | +@ AND mlink.fid=blob.rid | |
| 914 | 908 | @ AND mlink.fid!=mlink.pid |
| 915 | -@ ORDER BY event.mtime DESC; | |
| 909 | +@ AND mlink.mid IN (SELECT x FROM ckin) | |
| 910 | +@ AND event.objid=mlink.mid | |
| 911 | +@ ORDER BY event.mtime ASC; | |
| 916 | 912 | ; |
| 917 | - | |
| 918 | 913 | |
| 919 | 914 | /* |
| 920 | 915 | ** Look at all file containing in the version "vid". Construct a |
| 921 | 916 | ** temporary table named "fileage" that contains the file-id for each |
| 922 | 917 | ** files, the pathname, the check-in where the file was added, and the |
| @@ -924,15 +919,11 @@ | ||
| 924 | 919 | ** the given glob are computed. |
| 925 | 920 | */ |
| 926 | 921 | int compute_fileage(int vid, const char* zGlob){ |
| 927 | 922 | Stmt q; |
| 928 | 923 | db_multi_exec(zComputeFileAgeSetup /*works-like:"constant"*/); |
| 929 | - db_prepare(&q, zComputeFileAgeRun1 /*works-like:"constant"*/); | |
| 930 | - db_bind_int(&q, ":ckin", vid); | |
| 931 | - db_exec(&q); | |
| 932 | - db_finalize(&q); | |
| 933 | - db_prepare(&q, zComputeFileAgeRun2 /*works-like:"constant"*/); | |
| 924 | + db_prepare(&q, zComputeFileAgeRun /*works-like:"constant"*/); | |
| 934 | 925 | db_bind_int(&q, ":ckin", vid); |
| 935 | 926 | db_bind_text(&q, ":glob", zGlob && zGlob[0] ? zGlob : "*"); |
| 936 | 927 | db_exec(&q); |
| 937 | 928 | db_finalize(&q); |
| 938 | 929 | return 0; |
| @@ -999,17 +990,19 @@ | ||
| 999 | 990 | ** |
| 1000 | 991 | ** Parameters: |
| 1001 | 992 | ** name=VERSION Selects the checkin version (default=tip). |
| 1002 | 993 | ** glob=STRING Only shows files matching this glob pattern |
| 1003 | 994 | ** (e.g. *.c or *.txt). |
| 995 | +** showid Show RID values for debugging | |
| 1004 | 996 | */ |
| 1005 | 997 | void fileage_page(void){ |
| 1006 | 998 | int rid; |
| 1007 | 999 | const char *zName; |
| 1008 | 1000 | const char *zGlob; |
| 1009 | 1001 | const char *zUuid; |
| 1010 | 1002 | const char *zNow; /* Time of checkin */ |
| 1003 | + int showId = PB("showid"); | |
| 1011 | 1004 | Stmt q1, q2; |
| 1012 | 1005 | double baseTime; |
| 1013 | 1006 | login_check_credentials(); |
| 1014 | 1007 | if( !g.perm.Read ){ login_needed(); return; } |
| 1015 | 1008 | zName = P("name"); |
| @@ -1055,11 +1048,11 @@ | ||
| 1055 | 1048 | " AND blob.rid=event.objid\n" |
| 1056 | 1049 | " ORDER BY event.mtime DESC;", |
| 1057 | 1050 | TAG_BRANCH |
| 1058 | 1051 | ); |
| 1059 | 1052 | db_prepare(&q2, |
| 1060 | - "SELECT blob.uuid, filename.name\n" | |
| 1053 | + "SELECT blob.uuid, filename.name, fileage.fid\n" | |
| 1061 | 1054 | " FROM fileage, blob, filename\n" |
| 1062 | 1055 | " WHERE fileage.mid=:mid AND filename.fnid=fileage.fnid" |
| 1063 | 1056 | " AND blob.rid=fileage.fid;" |
| 1064 | 1057 | ); |
| 1065 | 1058 | while( db_step(&q1)==SQLITE_ROW ){ |
| @@ -1074,16 +1067,24 @@ | ||
| 1074 | 1067 | @ <td> |
| 1075 | 1068 | db_bind_int(&q2, ":mid", mid); |
| 1076 | 1069 | while( db_step(&q2)==SQLITE_ROW ){ |
| 1077 | 1070 | const char *zFUuid = db_column_text(&q2,0); |
| 1078 | 1071 | const char *zFile = db_column_text(&q2,1); |
| 1079 | - @ %z(href("%R/artifact/%s",zFUuid))%h(zFile)</a><br> | |
| 1072 | + int fid = db_column_int(&q2,2); | |
| 1073 | + if( showId ){ | |
| 1074 | + @ %z(href("%R/artifact/%s",zFUuid))%h(zFile)</a> (%d(fid))<br> | |
| 1075 | + }else{ | |
| 1076 | + @ %z(href("%R/artifact/%s",zFUuid))%h(zFile)</a><br> | |
| 1077 | + } | |
| 1080 | 1078 | } |
| 1081 | 1079 | db_reset(&q2); |
| 1082 | 1080 | @ </td> |
| 1083 | 1081 | @ <td> |
| 1084 | 1082 | @ %z(href("%R/info/%s",zUuid))[%S(zUuid)]</a> |
| 1083 | + if( showId ){ | |
| 1084 | + @ (%d(mid)) | |
| 1085 | + } | |
| 1085 | 1086 | @ %W(zComment) (user: |
| 1086 | 1087 | @ %z(href("%R/timeline?u=%t&c=%t&nd&n=200",zUser,zUuid))%h(zUser)</a>, |
| 1087 | 1088 | @ branch: |
| 1088 | 1089 | @ %z(href("%R/timeline?r=%t&c=%t&nd&n=200",zBranch,zUuid))%h(zBranch)</a>) |
| 1089 | 1090 | @ </td></tr> |
| 1090 | 1091 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -885,38 +885,33 @@ | |
| 885 | @ mid INTEGER, |
| 886 | @ mtime DATETIME, |
| 887 | @ pathname TEXT |
| 888 | @ ); |
| 889 | @ CREATE VIRTUAL TABLE IF NOT EXISTS temp.foci USING files_of_checkin; |
| 890 | @ CREATE TEMP TABLE descendents(x INTEGER PRIMARY KEY); |
| 891 | ; |
| 892 | |
| 893 | static const char zComputeFileAgeRun1[] = |
| 894 | @ WITH RECURSIVE |
| 895 | @ ckin(x,m) AS (SELECT objid, mtime FROM event WHERE objid=:ckin |
| 896 | @ UNION |
| 897 | @ SELECT plink.pid, event.mtime |
| 898 | @ FROM ckin, plink, event |
| 899 | @ WHERE plink.cid=ckin.x AND event.objid=plink.pid |
| 900 | @ ORDER BY 2 DESC) |
| 901 | @ INSERT INTO descendents SELECT x FROM ckin; |
| 902 | ; |
| 903 | static const char zComputeFileAgeRun2[] = |
| 904 | @ INSERT OR IGNORE INTO fileage(fnid, fid, mid, mtime, pathname) |
| 905 | @ SELECT mlink.fnid, mlink.fid, x, event.mtime, filename.name |
| 906 | @ FROM descendents, mlink, event, filename |
| 907 | @ WHERE mlink.mid=descendents.x |
| 908 | @ AND mlink.fnid IN (SELECT fnid FROM foci, filename |
| 909 | @ WHERE foci.checkinID=:ckin |
| 910 | @ AND filename.name=foci.filename |
| 911 | @ AND filename.name GLOB :glob) |
| 912 | @ AND filename.fnid=mlink.fnid |
| 913 | @ AND event.objid=mlink.mid |
| 914 | @ AND mlink.fid!=mlink.pid |
| 915 | @ ORDER BY event.mtime DESC; |
| 916 | ; |
| 917 | |
| 918 | |
| 919 | /* |
| 920 | ** Look at all file containing in the version "vid". Construct a |
| 921 | ** temporary table named "fileage" that contains the file-id for each |
| 922 | ** files, the pathname, the check-in where the file was added, and the |
| @@ -924,15 +919,11 @@ | |
| 924 | ** the given glob are computed. |
| 925 | */ |
| 926 | int compute_fileage(int vid, const char* zGlob){ |
| 927 | Stmt q; |
| 928 | db_multi_exec(zComputeFileAgeSetup /*works-like:"constant"*/); |
| 929 | db_prepare(&q, zComputeFileAgeRun1 /*works-like:"constant"*/); |
| 930 | db_bind_int(&q, ":ckin", vid); |
| 931 | db_exec(&q); |
| 932 | db_finalize(&q); |
| 933 | db_prepare(&q, zComputeFileAgeRun2 /*works-like:"constant"*/); |
| 934 | db_bind_int(&q, ":ckin", vid); |
| 935 | db_bind_text(&q, ":glob", zGlob && zGlob[0] ? zGlob : "*"); |
| 936 | db_exec(&q); |
| 937 | db_finalize(&q); |
| 938 | return 0; |
| @@ -999,17 +990,19 @@ | |
| 999 | ** |
| 1000 | ** Parameters: |
| 1001 | ** name=VERSION Selects the checkin version (default=tip). |
| 1002 | ** glob=STRING Only shows files matching this glob pattern |
| 1003 | ** (e.g. *.c or *.txt). |
| 1004 | */ |
| 1005 | void fileage_page(void){ |
| 1006 | int rid; |
| 1007 | const char *zName; |
| 1008 | const char *zGlob; |
| 1009 | const char *zUuid; |
| 1010 | const char *zNow; /* Time of checkin */ |
| 1011 | Stmt q1, q2; |
| 1012 | double baseTime; |
| 1013 | login_check_credentials(); |
| 1014 | if( !g.perm.Read ){ login_needed(); return; } |
| 1015 | zName = P("name"); |
| @@ -1055,11 +1048,11 @@ | |
| 1055 | " AND blob.rid=event.objid\n" |
| 1056 | " ORDER BY event.mtime DESC;", |
| 1057 | TAG_BRANCH |
| 1058 | ); |
| 1059 | db_prepare(&q2, |
| 1060 | "SELECT blob.uuid, filename.name\n" |
| 1061 | " FROM fileage, blob, filename\n" |
| 1062 | " WHERE fileage.mid=:mid AND filename.fnid=fileage.fnid" |
| 1063 | " AND blob.rid=fileage.fid;" |
| 1064 | ); |
| 1065 | while( db_step(&q1)==SQLITE_ROW ){ |
| @@ -1074,16 +1067,24 @@ | |
| 1074 | @ <td> |
| 1075 | db_bind_int(&q2, ":mid", mid); |
| 1076 | while( db_step(&q2)==SQLITE_ROW ){ |
| 1077 | const char *zFUuid = db_column_text(&q2,0); |
| 1078 | const char *zFile = db_column_text(&q2,1); |
| 1079 | @ %z(href("%R/artifact/%s",zFUuid))%h(zFile)</a><br> |
| 1080 | } |
| 1081 | db_reset(&q2); |
| 1082 | @ </td> |
| 1083 | @ <td> |
| 1084 | @ %z(href("%R/info/%s",zUuid))[%S(zUuid)]</a> |
| 1085 | @ %W(zComment) (user: |
| 1086 | @ %z(href("%R/timeline?u=%t&c=%t&nd&n=200",zUser,zUuid))%h(zUser)</a>, |
| 1087 | @ branch: |
| 1088 | @ %z(href("%R/timeline?r=%t&c=%t&nd&n=200",zBranch,zUuid))%h(zBranch)</a>) |
| 1089 | @ </td></tr> |
| 1090 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -885,38 +885,33 @@ | |
| 885 | @ mid INTEGER, |
| 886 | @ mtime DATETIME, |
| 887 | @ pathname TEXT |
| 888 | @ ); |
| 889 | @ CREATE VIRTUAL TABLE IF NOT EXISTS temp.foci USING files_of_checkin; |
| 890 | ; |
| 891 | |
| 892 | static const char zComputeFileAgeRun[] = |
| 893 | @ WITH RECURSIVE |
| 894 | @ ckin(x,m) AS (SELECT objid, mtime FROM event WHERE objid=:ckin |
| 895 | @ UNION |
| 896 | @ SELECT plink.pid, event.mtime |
| 897 | @ FROM ckin, plink, event |
| 898 | @ WHERE plink.cid=ckin.x AND event.objid=plink.pid |
| 899 | @ ORDER BY 2 DESC) |
| 900 | @ INSERT OR IGNORE INTO fileage(fnid, fid, mid, mtime, pathname) |
| 901 | @ SELECT filename.fnid, mlink.fid, mlink.mid, event.mtime, filename.name |
| 902 | @ FROM foci, filename, blob, mlink, event |
| 903 | @ WHERE foci.checkinID=:ckin |
| 904 | @ AND foci.filename GLOB :glob |
| 905 | @ AND filename.name=foci.filename |
| 906 | @ AND blob.uuid=foci.uuid |
| 907 | @ AND mlink.fid=blob.rid |
| 908 | @ AND mlink.fid!=mlink.pid |
| 909 | @ AND mlink.mid IN (SELECT x FROM ckin) |
| 910 | @ AND event.objid=mlink.mid |
| 911 | @ ORDER BY event.mtime ASC; |
| 912 | ; |
| 913 | |
| 914 | /* |
| 915 | ** Look at all file containing in the version "vid". Construct a |
| 916 | ** temporary table named "fileage" that contains the file-id for each |
| 917 | ** files, the pathname, the check-in where the file was added, and the |
| @@ -924,15 +919,11 @@ | |
| 919 | ** the given glob are computed. |
| 920 | */ |
| 921 | int compute_fileage(int vid, const char* zGlob){ |
| 922 | Stmt q; |
| 923 | db_multi_exec(zComputeFileAgeSetup /*works-like:"constant"*/); |
| 924 | db_prepare(&q, zComputeFileAgeRun /*works-like:"constant"*/); |
| 925 | db_bind_int(&q, ":ckin", vid); |
| 926 | db_bind_text(&q, ":glob", zGlob && zGlob[0] ? zGlob : "*"); |
| 927 | db_exec(&q); |
| 928 | db_finalize(&q); |
| 929 | return 0; |
| @@ -999,17 +990,19 @@ | |
| 990 | ** |
| 991 | ** Parameters: |
| 992 | ** name=VERSION Selects the checkin version (default=tip). |
| 993 | ** glob=STRING Only shows files matching this glob pattern |
| 994 | ** (e.g. *.c or *.txt). |
| 995 | ** showid Show RID values for debugging |
| 996 | */ |
| 997 | void fileage_page(void){ |
| 998 | int rid; |
| 999 | const char *zName; |
| 1000 | const char *zGlob; |
| 1001 | const char *zUuid; |
| 1002 | const char *zNow; /* Time of checkin */ |
| 1003 | int showId = PB("showid"); |
| 1004 | Stmt q1, q2; |
| 1005 | double baseTime; |
| 1006 | login_check_credentials(); |
| 1007 | if( !g.perm.Read ){ login_needed(); return; } |
| 1008 | zName = P("name"); |
| @@ -1055,11 +1048,11 @@ | |
| 1048 | " AND blob.rid=event.objid\n" |
| 1049 | " ORDER BY event.mtime DESC;", |
| 1050 | TAG_BRANCH |
| 1051 | ); |
| 1052 | db_prepare(&q2, |
| 1053 | "SELECT blob.uuid, filename.name, fileage.fid\n" |
| 1054 | " FROM fileage, blob, filename\n" |
| 1055 | " WHERE fileage.mid=:mid AND filename.fnid=fileage.fnid" |
| 1056 | " AND blob.rid=fileage.fid;" |
| 1057 | ); |
| 1058 | while( db_step(&q1)==SQLITE_ROW ){ |
| @@ -1074,16 +1067,24 @@ | |
| 1067 | @ <td> |
| 1068 | db_bind_int(&q2, ":mid", mid); |
| 1069 | while( db_step(&q2)==SQLITE_ROW ){ |
| 1070 | const char *zFUuid = db_column_text(&q2,0); |
| 1071 | const char *zFile = db_column_text(&q2,1); |
| 1072 | int fid = db_column_int(&q2,2); |
| 1073 | if( showId ){ |
| 1074 | @ %z(href("%R/artifact/%s",zFUuid))%h(zFile)</a> (%d(fid))<br> |
| 1075 | }else{ |
| 1076 | @ %z(href("%R/artifact/%s",zFUuid))%h(zFile)</a><br> |
| 1077 | } |
| 1078 | } |
| 1079 | db_reset(&q2); |
| 1080 | @ </td> |
| 1081 | @ <td> |
| 1082 | @ %z(href("%R/info/%s",zUuid))[%S(zUuid)]</a> |
| 1083 | if( showId ){ |
| 1084 | @ (%d(mid)) |
| 1085 | } |
| 1086 | @ %W(zComment) (user: |
| 1087 | @ %z(href("%R/timeline?u=%t&c=%t&nd&n=200",zUser,zUuid))%h(zUser)</a>, |
| 1088 | @ branch: |
| 1089 | @ %z(href("%R/timeline?r=%t&c=%t&nd&n=200",zBranch,zUuid))%h(zBranch)</a>) |
| 1090 | @ </td></tr> |
| 1091 |
+11
-5
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -509,36 +509,42 @@ | ||
| 509 | 509 | int isDel = fid==0; |
| 510 | 510 | const char *zOldName = db_column_text(&fchngQuery, 5); |
| 511 | 511 | const char *zOld = db_column_text(&fchngQuery, 4); |
| 512 | 512 | const char *zNew = db_column_text(&fchngQuery, 3); |
| 513 | 513 | const char *zUnpubTag = ""; |
| 514 | + char zId[20]; | |
| 514 | 515 | if( !inUl ){ |
| 515 | 516 | @ <ul class="filelist"> |
| 516 | 517 | inUl = 1; |
| 518 | + } | |
| 519 | + if( tmFlags & TIMELINE_SHOWRID ){ | |
| 520 | + sqlite3_snprintf(sizeof(zId), zId, " (%d) ", fid); | |
| 521 | + }else{ | |
| 522 | + zId[0] = 0; | |
| 517 | 523 | } |
| 518 | 524 | if( (tmFlags & TIMELINE_FRENAMES)!=0 ){ |
| 519 | 525 | if( !isNew && !isDel && zOldName!=0 ){ |
| 520 | - @ <li> %h(zOldName) → %h(zFilename) | |
| 526 | + @ <li> %h(zOldName) → %h(zFilename)%s(zId) | |
| 521 | 527 | } |
| 522 | 528 | continue; |
| 523 | 529 | } |
| 524 | 530 | if( content_is_private(fid) ){ |
| 525 | 531 | zUnpubTag = UNPUB_TAG; |
| 526 | 532 | } |
| 527 | 533 | if( isNew ){ |
| 528 | - @ <li> %h(zFilename) %s(zUnpubTag) (new file) | |
| 534 | + @ <li> %h(zFilename)%s(zId) %s(zUnpubTag) (new file) | |
| 529 | 535 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 530 | 536 | }else if( isDel ){ |
| 531 | 537 | @ <li> %h(zFilename) (deleted)</li> |
| 532 | 538 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 533 | - @ <li> %h(zOldName) → %h(zFilename) %s(zUnpubTag) | |
| 539 | + @ <li> %h(zOldName) → %h(zFilename)%s(zId) %s(zUnpubTag) | |
| 534 | 540 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 535 | 541 | }else{ |
| 536 | 542 | if( zOldName!=0 ){ |
| 537 | - @ <li> %h(zOldName) → %h(zFilename) %s(zUnpubTag) | |
| 543 | + @ <li> %h(zOldName) → %h(zFilename)%s(zId) %s(zUnpubTag) | |
| 538 | 544 | }else{ |
| 539 | - @ <li> %h(zFilename) %s(zUnpubTag) | |
| 545 | + @ <li> %h(zFilename)%s(zId) %s(zUnpubTag) | |
| 540 | 546 | } |
| 541 | 547 | @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zOld,zNew))[diff]</a></li> |
| 542 | 548 | } |
| 543 | 549 | } |
| 544 | 550 | db_reset(&fchngQuery); |
| 545 | 551 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -509,36 +509,42 @@ | |
| 509 | int isDel = fid==0; |
| 510 | const char *zOldName = db_column_text(&fchngQuery, 5); |
| 511 | const char *zOld = db_column_text(&fchngQuery, 4); |
| 512 | const char *zNew = db_column_text(&fchngQuery, 3); |
| 513 | const char *zUnpubTag = ""; |
| 514 | if( !inUl ){ |
| 515 | @ <ul class="filelist"> |
| 516 | inUl = 1; |
| 517 | } |
| 518 | if( (tmFlags & TIMELINE_FRENAMES)!=0 ){ |
| 519 | if( !isNew && !isDel && zOldName!=0 ){ |
| 520 | @ <li> %h(zOldName) → %h(zFilename) |
| 521 | } |
| 522 | continue; |
| 523 | } |
| 524 | if( content_is_private(fid) ){ |
| 525 | zUnpubTag = UNPUB_TAG; |
| 526 | } |
| 527 | if( isNew ){ |
| 528 | @ <li> %h(zFilename) %s(zUnpubTag) (new file) |
| 529 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 530 | }else if( isDel ){ |
| 531 | @ <li> %h(zFilename) (deleted)</li> |
| 532 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 533 | @ <li> %h(zOldName) → %h(zFilename) %s(zUnpubTag) |
| 534 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 535 | }else{ |
| 536 | if( zOldName!=0 ){ |
| 537 | @ <li> %h(zOldName) → %h(zFilename) %s(zUnpubTag) |
| 538 | }else{ |
| 539 | @ <li> %h(zFilename) %s(zUnpubTag) |
| 540 | } |
| 541 | @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zOld,zNew))[diff]</a></li> |
| 542 | } |
| 543 | } |
| 544 | db_reset(&fchngQuery); |
| 545 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -509,36 +509,42 @@ | |
| 509 | int isDel = fid==0; |
| 510 | const char *zOldName = db_column_text(&fchngQuery, 5); |
| 511 | const char *zOld = db_column_text(&fchngQuery, 4); |
| 512 | const char *zNew = db_column_text(&fchngQuery, 3); |
| 513 | const char *zUnpubTag = ""; |
| 514 | char zId[20]; |
| 515 | if( !inUl ){ |
| 516 | @ <ul class="filelist"> |
| 517 | inUl = 1; |
| 518 | } |
| 519 | if( tmFlags & TIMELINE_SHOWRID ){ |
| 520 | sqlite3_snprintf(sizeof(zId), zId, " (%d) ", fid); |
| 521 | }else{ |
| 522 | zId[0] = 0; |
| 523 | } |
| 524 | if( (tmFlags & TIMELINE_FRENAMES)!=0 ){ |
| 525 | if( !isNew && !isDel && zOldName!=0 ){ |
| 526 | @ <li> %h(zOldName) → %h(zFilename)%s(zId) |
| 527 | } |
| 528 | continue; |
| 529 | } |
| 530 | if( content_is_private(fid) ){ |
| 531 | zUnpubTag = UNPUB_TAG; |
| 532 | } |
| 533 | if( isNew ){ |
| 534 | @ <li> %h(zFilename)%s(zId) %s(zUnpubTag) (new file) |
| 535 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 536 | }else if( isDel ){ |
| 537 | @ <li> %h(zFilename) (deleted)</li> |
| 538 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 539 | @ <li> %h(zOldName) → %h(zFilename)%s(zId) %s(zUnpubTag) |
| 540 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 541 | }else{ |
| 542 | if( zOldName!=0 ){ |
| 543 | @ <li> %h(zOldName) → %h(zFilename)%s(zId) %s(zUnpubTag) |
| 544 | }else{ |
| 545 | @ <li> %h(zFilename)%s(zId) %s(zUnpubTag) |
| 546 | } |
| 547 | @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zOld,zNew))[diff]</a></li> |
| 548 | } |
| 549 | } |
| 550 | db_reset(&fchngQuery); |
| 551 |