Fossil SCM
Tweaks to the header text for /tree and /fileage.
Commit
b4775276fbdd6d3c191917388c9b22a7c5358991
Parent
e99255f0a5bb12d…
1 file changed
+27
-17
+27
-17
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -523,10 +523,11 @@ | ||
| 523 | 523 | char *zUuid = 0; |
| 524 | 524 | Blob dirname; |
| 525 | 525 | Manifest *pM = 0; |
| 526 | 526 | double rNow = 0; |
| 527 | 527 | char *zNow = 0; |
| 528 | + int useMtime = atoi(PD("mtime","0")); | |
| 528 | 529 | int nFile = 0; /* Number of files (or folders with "nofiles") */ |
| 529 | 530 | int linkTrunk = 1; /* include link to "trunk" */ |
| 530 | 531 | int linkTip = 1; /* include link to "tip" */ |
| 531 | 532 | const char *zRE; /* the value for the re=REGEXP query parameter */ |
| 532 | 533 | const char *zObjType; /* "files" by default or "folders" for "nofiles" */ |
| @@ -590,10 +591,12 @@ | ||
| 590 | 591 | zNow = db_text("", "SELECT datetime(mtime,'localtime')" |
| 591 | 592 | " FROM event WHERE objid=%d", rid); |
| 592 | 593 | }else{ |
| 593 | 594 | zCI = 0; |
| 594 | 595 | } |
| 596 | + }else{ | |
| 597 | + useMtime = 0; | |
| 595 | 598 | } |
| 596 | 599 | |
| 597 | 600 | /* Compute the title of the page */ |
| 598 | 601 | blob_zero(&dirname); |
| 599 | 602 | if( zD ){ |
| @@ -617,11 +620,11 @@ | ||
| 617 | 620 | url_render(&sURI, "ci", 0, 0, 0)); |
| 618 | 621 | if( nD==0 && !showDirOnly ){ |
| 619 | 622 | style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s", |
| 620 | 623 | zUuid); |
| 621 | 624 | } |
| 622 | - if( P("mtime")!=0 ){ | |
| 625 | + if( useMtime ){ | |
| 623 | 626 | style_submenu_element("Sort By Filename","Sort By Filename", "%s", |
| 624 | 627 | url_render(&sURI, 0, 0, 0, 0)); |
| 625 | 628 | url_add_parameter(&sURI, "mtime", "1"); |
| 626 | 629 | }else{ |
| 627 | 630 | style_submenu_element("Sort By Time","Sort By Time", "%s", |
| @@ -675,28 +678,33 @@ | ||
| 675 | 678 | |
| 676 | 679 | if( showDirOnly ){ |
| 677 | 680 | for(nFile=0, p=sTree.pFirst; p; p=p->pNext){ |
| 678 | 681 | if( p->pChild!=0 && p->nFullName>nD ) nFile++; |
| 679 | 682 | } |
| 680 | - zObjType = "folders"; | |
| 683 | + zObjType = "Folders"; | |
| 681 | 684 | style_submenu_element("Files","Files","%s", |
| 682 | 685 | url_render(&sURI,"nofiles",0,0,0)); |
| 683 | 686 | }else{ |
| 684 | - zObjType = "files"; | |
| 687 | + zObjType = "Files"; | |
| 685 | 688 | style_submenu_element("Folders","Folders","%s", |
| 686 | 689 | url_render(&sURI,"nofiles","1",0,0)); |
| 687 | 690 | } |
| 688 | 691 | |
| 689 | 692 | if( zCI ){ |
| 690 | - @ <h2>%d(nFile) %s(zObjType) of check-in | |
| 693 | + @ <h2>%s(zObjType) from | |
| 691 | 694 | if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){ |
| 692 | 695 | @ "%h(zCI)" |
| 693 | 696 | } |
| 694 | - @ [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname))</h2> | |
| 697 | + @ [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname)) | |
| 698 | + if( useMtime ){ | |
| 699 | + @ sorted by modification time</h2> | |
| 700 | + }else{ | |
| 701 | + @ sorted by filename</h2> | |
| 702 | + } | |
| 695 | 703 | }else{ |
| 696 | 704 | int n = db_int(0, "SELECT count(*) FROM plink"); |
| 697 | - @ <h2>%d(nFile) %s(zObjType) from all %d(n) check-ins | |
| 705 | + @ <h2>%s(zObjType) from all %d(n) check-ins | |
| 698 | 706 | @ %s(blob_str(&dirname))</h2> |
| 699 | 707 | } |
| 700 | 708 | |
| 701 | 709 | |
| 702 | 710 | /* Generate tree of lists. |
| @@ -721,11 +729,11 @@ | ||
| 721 | 729 | if( zNow ){ |
| 722 | 730 | @ <div class="filetreeage">%s(zNow)</div> |
| 723 | 731 | } |
| 724 | 732 | @ </div> |
| 725 | 733 | @ <ul> |
| 726 | - if( zCI && P("mtime")!=0 ){ | |
| 734 | + if( zCI && useMtime ){ | |
| 727 | 735 | p = sortTreeByMtime(sTree.pFirst); |
| 728 | 736 | memset(&sTree, 0, sizeof(sTree)); |
| 729 | 737 | relinkTree(&sTree, p); |
| 730 | 738 | } |
| 731 | 739 | for(p=sTree.pFirst, nDir=0; p; p=p->pNext){ |
| @@ -998,25 +1006,27 @@ | ||
| 998 | 1006 | } |
| 999 | 1007 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1000 | 1008 | baseTime = db_double(0.0,"SELECT mtime FROM event WHERE objid=%d", rid); |
| 1001 | 1009 | zNow = db_text("", "SELECT datetime(mtime,'localtime') FROM event" |
| 1002 | 1010 | " WHERE objid=%d", rid); |
| 1003 | - style_submenu_element("Tree-View", "Tree-View", "%R/tree?ci=%T", zName); | |
| 1011 | + style_submenu_element("Tree-View", "Tree-View", "%R/tree?ci=%T&mtime=1", | |
| 1012 | + zName); | |
| 1004 | 1013 | style_header("File Ages"); |
| 1005 | 1014 | zGlob = P("glob"); |
| 1006 | 1015 | compute_fileage(rid,zGlob); |
| 1007 | 1016 | db_multi_exec("CREATE INDEX fileage_ix1 ON fileage(mid,pathname);"); |
| 1008 | 1017 | |
| 1009 | - @ <h2>Most recent change to files in checkin | |
| 1010 | - @ %z(href("%R/info?name=%T",zUuid))%S(zUuid)</a> | |
| 1011 | - if( zGlob && zGlob[0] ){ | |
| 1012 | - @ that match "%h(zGlob)" | |
| 1013 | - } | |
| 1014 | - @</h2> | |
| 1015 | - @ | |
| 1016 | - @ <p>All times are shown relative to the check-in time for | |
| 1017 | - @ %S(zUuid) which was %s(zNow).</p> | |
| 1018 | + @ <h2>Files in | |
| 1019 | + @ %z(href("%R/info?name=%T",zUuid))[%S(zUuid)]</a> | |
| 1020 | + if( zGlob && zGlob[0] ){ | |
| 1021 | + @ that match "%h(zGlob)" and | |
| 1022 | + } | |
| 1023 | + @ ordered by check-in time</h2> | |
| 1024 | + @ | |
| 1025 | + @ <p>Times are relative to the checkin time for | |
| 1026 | + @ %z(href("%R/ci/%s",zUuid))[%S(zUuid)]</a> which is | |
| 1027 | + @ %z(href("%R/timeline?c=%t",zNow))%s(zNow)</a>.</p> | |
| 1018 | 1028 | @ |
| 1019 | 1029 | @ <div class='fileage'><table> |
| 1020 | 1030 | @ <tr><th>Time</th><th>Files</th><th>Checkin</th></tr> |
| 1021 | 1031 | db_prepare(&q1, |
| 1022 | 1032 | "SELECT event.mtime, event.objid, blob.uuid,\n" |
| 1023 | 1033 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -523,10 +523,11 @@ | |
| 523 | char *zUuid = 0; |
| 524 | Blob dirname; |
| 525 | Manifest *pM = 0; |
| 526 | double rNow = 0; |
| 527 | char *zNow = 0; |
| 528 | int nFile = 0; /* Number of files (or folders with "nofiles") */ |
| 529 | int linkTrunk = 1; /* include link to "trunk" */ |
| 530 | int linkTip = 1; /* include link to "tip" */ |
| 531 | const char *zRE; /* the value for the re=REGEXP query parameter */ |
| 532 | const char *zObjType; /* "files" by default or "folders" for "nofiles" */ |
| @@ -590,10 +591,12 @@ | |
| 590 | zNow = db_text("", "SELECT datetime(mtime,'localtime')" |
| 591 | " FROM event WHERE objid=%d", rid); |
| 592 | }else{ |
| 593 | zCI = 0; |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | /* Compute the title of the page */ |
| 598 | blob_zero(&dirname); |
| 599 | if( zD ){ |
| @@ -617,11 +620,11 @@ | |
| 617 | url_render(&sURI, "ci", 0, 0, 0)); |
| 618 | if( nD==0 && !showDirOnly ){ |
| 619 | style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s", |
| 620 | zUuid); |
| 621 | } |
| 622 | if( P("mtime")!=0 ){ |
| 623 | style_submenu_element("Sort By Filename","Sort By Filename", "%s", |
| 624 | url_render(&sURI, 0, 0, 0, 0)); |
| 625 | url_add_parameter(&sURI, "mtime", "1"); |
| 626 | }else{ |
| 627 | style_submenu_element("Sort By Time","Sort By Time", "%s", |
| @@ -675,28 +678,33 @@ | |
| 675 | |
| 676 | if( showDirOnly ){ |
| 677 | for(nFile=0, p=sTree.pFirst; p; p=p->pNext){ |
| 678 | if( p->pChild!=0 && p->nFullName>nD ) nFile++; |
| 679 | } |
| 680 | zObjType = "folders"; |
| 681 | style_submenu_element("Files","Files","%s", |
| 682 | url_render(&sURI,"nofiles",0,0,0)); |
| 683 | }else{ |
| 684 | zObjType = "files"; |
| 685 | style_submenu_element("Folders","Folders","%s", |
| 686 | url_render(&sURI,"nofiles","1",0,0)); |
| 687 | } |
| 688 | |
| 689 | if( zCI ){ |
| 690 | @ <h2>%d(nFile) %s(zObjType) of check-in |
| 691 | if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){ |
| 692 | @ "%h(zCI)" |
| 693 | } |
| 694 | @ [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname))</h2> |
| 695 | }else{ |
| 696 | int n = db_int(0, "SELECT count(*) FROM plink"); |
| 697 | @ <h2>%d(nFile) %s(zObjType) from all %d(n) check-ins |
| 698 | @ %s(blob_str(&dirname))</h2> |
| 699 | } |
| 700 | |
| 701 | |
| 702 | /* Generate tree of lists. |
| @@ -721,11 +729,11 @@ | |
| 721 | if( zNow ){ |
| 722 | @ <div class="filetreeage">%s(zNow)</div> |
| 723 | } |
| 724 | @ </div> |
| 725 | @ <ul> |
| 726 | if( zCI && P("mtime")!=0 ){ |
| 727 | p = sortTreeByMtime(sTree.pFirst); |
| 728 | memset(&sTree, 0, sizeof(sTree)); |
| 729 | relinkTree(&sTree, p); |
| 730 | } |
| 731 | for(p=sTree.pFirst, nDir=0; p; p=p->pNext){ |
| @@ -998,25 +1006,27 @@ | |
| 998 | } |
| 999 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1000 | baseTime = db_double(0.0,"SELECT mtime FROM event WHERE objid=%d", rid); |
| 1001 | zNow = db_text("", "SELECT datetime(mtime,'localtime') FROM event" |
| 1002 | " WHERE objid=%d", rid); |
| 1003 | style_submenu_element("Tree-View", "Tree-View", "%R/tree?ci=%T", zName); |
| 1004 | style_header("File Ages"); |
| 1005 | zGlob = P("glob"); |
| 1006 | compute_fileage(rid,zGlob); |
| 1007 | db_multi_exec("CREATE INDEX fileage_ix1 ON fileage(mid,pathname);"); |
| 1008 | |
| 1009 | @ <h2>Most recent change to files in checkin |
| 1010 | @ %z(href("%R/info?name=%T",zUuid))%S(zUuid)</a> |
| 1011 | if( zGlob && zGlob[0] ){ |
| 1012 | @ that match "%h(zGlob)" |
| 1013 | } |
| 1014 | @</h2> |
| 1015 | @ |
| 1016 | @ <p>All times are shown relative to the check-in time for |
| 1017 | @ %S(zUuid) which was %s(zNow).</p> |
| 1018 | @ |
| 1019 | @ <div class='fileage'><table> |
| 1020 | @ <tr><th>Time</th><th>Files</th><th>Checkin</th></tr> |
| 1021 | db_prepare(&q1, |
| 1022 | "SELECT event.mtime, event.objid, blob.uuid,\n" |
| 1023 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -523,10 +523,11 @@ | |
| 523 | char *zUuid = 0; |
| 524 | Blob dirname; |
| 525 | Manifest *pM = 0; |
| 526 | double rNow = 0; |
| 527 | char *zNow = 0; |
| 528 | int useMtime = atoi(PD("mtime","0")); |
| 529 | int nFile = 0; /* Number of files (or folders with "nofiles") */ |
| 530 | int linkTrunk = 1; /* include link to "trunk" */ |
| 531 | int linkTip = 1; /* include link to "tip" */ |
| 532 | const char *zRE; /* the value for the re=REGEXP query parameter */ |
| 533 | const char *zObjType; /* "files" by default or "folders" for "nofiles" */ |
| @@ -590,10 +591,12 @@ | |
| 591 | zNow = db_text("", "SELECT datetime(mtime,'localtime')" |
| 592 | " FROM event WHERE objid=%d", rid); |
| 593 | }else{ |
| 594 | zCI = 0; |
| 595 | } |
| 596 | }else{ |
| 597 | useMtime = 0; |
| 598 | } |
| 599 | |
| 600 | /* Compute the title of the page */ |
| 601 | blob_zero(&dirname); |
| 602 | if( zD ){ |
| @@ -617,11 +620,11 @@ | |
| 620 | url_render(&sURI, "ci", 0, 0, 0)); |
| 621 | if( nD==0 && !showDirOnly ){ |
| 622 | style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s", |
| 623 | zUuid); |
| 624 | } |
| 625 | if( useMtime ){ |
| 626 | style_submenu_element("Sort By Filename","Sort By Filename", "%s", |
| 627 | url_render(&sURI, 0, 0, 0, 0)); |
| 628 | url_add_parameter(&sURI, "mtime", "1"); |
| 629 | }else{ |
| 630 | style_submenu_element("Sort By Time","Sort By Time", "%s", |
| @@ -675,28 +678,33 @@ | |
| 678 | |
| 679 | if( showDirOnly ){ |
| 680 | for(nFile=0, p=sTree.pFirst; p; p=p->pNext){ |
| 681 | if( p->pChild!=0 && p->nFullName>nD ) nFile++; |
| 682 | } |
| 683 | zObjType = "Folders"; |
| 684 | style_submenu_element("Files","Files","%s", |
| 685 | url_render(&sURI,"nofiles",0,0,0)); |
| 686 | }else{ |
| 687 | zObjType = "Files"; |
| 688 | style_submenu_element("Folders","Folders","%s", |
| 689 | url_render(&sURI,"nofiles","1",0,0)); |
| 690 | } |
| 691 | |
| 692 | if( zCI ){ |
| 693 | @ <h2>%s(zObjType) from |
| 694 | if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){ |
| 695 | @ "%h(zCI)" |
| 696 | } |
| 697 | @ [%z(href("vinfo?name=%s",zUuid))%S(zUuid)</a>] %s(blob_str(&dirname)) |
| 698 | if( useMtime ){ |
| 699 | @ sorted by modification time</h2> |
| 700 | }else{ |
| 701 | @ sorted by filename</h2> |
| 702 | } |
| 703 | }else{ |
| 704 | int n = db_int(0, "SELECT count(*) FROM plink"); |
| 705 | @ <h2>%s(zObjType) from all %d(n) check-ins |
| 706 | @ %s(blob_str(&dirname))</h2> |
| 707 | } |
| 708 | |
| 709 | |
| 710 | /* Generate tree of lists. |
| @@ -721,11 +729,11 @@ | |
| 729 | if( zNow ){ |
| 730 | @ <div class="filetreeage">%s(zNow)</div> |
| 731 | } |
| 732 | @ </div> |
| 733 | @ <ul> |
| 734 | if( zCI && useMtime ){ |
| 735 | p = sortTreeByMtime(sTree.pFirst); |
| 736 | memset(&sTree, 0, sizeof(sTree)); |
| 737 | relinkTree(&sTree, p); |
| 738 | } |
| 739 | for(p=sTree.pFirst, nDir=0; p; p=p->pNext){ |
| @@ -998,25 +1006,27 @@ | |
| 1006 | } |
| 1007 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1008 | baseTime = db_double(0.0,"SELECT mtime FROM event WHERE objid=%d", rid); |
| 1009 | zNow = db_text("", "SELECT datetime(mtime,'localtime') FROM event" |
| 1010 | " WHERE objid=%d", rid); |
| 1011 | style_submenu_element("Tree-View", "Tree-View", "%R/tree?ci=%T&mtime=1", |
| 1012 | zName); |
| 1013 | style_header("File Ages"); |
| 1014 | zGlob = P("glob"); |
| 1015 | compute_fileage(rid,zGlob); |
| 1016 | db_multi_exec("CREATE INDEX fileage_ix1 ON fileage(mid,pathname);"); |
| 1017 | |
| 1018 | @ <h2>Files in |
| 1019 | @ %z(href("%R/info?name=%T",zUuid))[%S(zUuid)]</a> |
| 1020 | if( zGlob && zGlob[0] ){ |
| 1021 | @ that match "%h(zGlob)" and |
| 1022 | } |
| 1023 | @ ordered by check-in time</h2> |
| 1024 | @ |
| 1025 | @ <p>Times are relative to the checkin time for |
| 1026 | @ %z(href("%R/ci/%s",zUuid))[%S(zUuid)]</a> which is |
| 1027 | @ %z(href("%R/timeline?c=%t",zNow))%s(zNow)</a>.</p> |
| 1028 | @ |
| 1029 | @ <div class='fileage'><table> |
| 1030 | @ <tr><th>Time</th><th>Files</th><th>Checkin</th></tr> |
| 1031 | db_prepare(&q1, |
| 1032 | "SELECT event.mtime, event.objid, blob.uuid,\n" |
| 1033 |