Fossil SCM

Tweaks to the header text for /tree and /fileage.

drh 2014-12-17 00:16 UTC age-in-file-tree
Commit b4775276fbdd6d3c191917388c9b22a7c5358991
1 file changed +27 -17
+27 -17
--- src/browse.c
+++ src/browse.c
@@ -523,10 +523,11 @@
523523
char *zUuid = 0;
524524
Blob dirname;
525525
Manifest *pM = 0;
526526
double rNow = 0;
527527
char *zNow = 0;
528
+ int useMtime = atoi(PD("mtime","0"));
528529
int nFile = 0; /* Number of files (or folders with "nofiles") */
529530
int linkTrunk = 1; /* include link to "trunk" */
530531
int linkTip = 1; /* include link to "tip" */
531532
const char *zRE; /* the value for the re=REGEXP query parameter */
532533
const char *zObjType; /* "files" by default or "folders" for "nofiles" */
@@ -590,10 +591,12 @@
590591
zNow = db_text("", "SELECT datetime(mtime,'localtime')"
591592
" FROM event WHERE objid=%d", rid);
592593
}else{
593594
zCI = 0;
594595
}
596
+ }else{
597
+ useMtime = 0;
595598
}
596599
597600
/* Compute the title of the page */
598601
blob_zero(&dirname);
599602
if( zD ){
@@ -617,11 +620,11 @@
617620
url_render(&sURI, "ci", 0, 0, 0));
618621
if( nD==0 && !showDirOnly ){
619622
style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s",
620623
zUuid);
621624
}
622
- if( P("mtime")!=0 ){
625
+ if( useMtime ){
623626
style_submenu_element("Sort By Filename","Sort By Filename", "%s",
624627
url_render(&sURI, 0, 0, 0, 0));
625628
url_add_parameter(&sURI, "mtime", "1");
626629
}else{
627630
style_submenu_element("Sort By Time","Sort By Time", "%s",
@@ -675,28 +678,33 @@
675678
676679
if( showDirOnly ){
677680
for(nFile=0, p=sTree.pFirst; p; p=p->pNext){
678681
if( p->pChild!=0 && p->nFullName>nD ) nFile++;
679682
}
680
- zObjType = "folders";
683
+ zObjType = "Folders";
681684
style_submenu_element("Files","Files","%s",
682685
url_render(&sURI,"nofiles",0,0,0));
683686
}else{
684
- zObjType = "files";
687
+ zObjType = "Files";
685688
style_submenu_element("Folders","Folders","%s",
686689
url_render(&sURI,"nofiles","1",0,0));
687690
}
688691
689692
if( zCI ){
690
- @ <h2>%d(nFile) %s(zObjType) of check-in
693
+ @ <h2>%s(zObjType) from
691694
if( sqlite3_strnicmp(zCI, zUuid, (int)strlen(zCI))!=0 ){
692695
@ "%h(zCI)"
693696
}
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
+ }
695703
}else{
696704
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
698706
@ %s(blob_str(&dirname))</h2>
699707
}
700708
701709
702710
/* Generate tree of lists.
@@ -721,11 +729,11 @@
721729
if( zNow ){
722730
@ <div class="filetreeage">%s(zNow)</div>
723731
}
724732
@ </div>
725733
@ <ul>
726
- if( zCI && P("mtime")!=0 ){
734
+ if( zCI && useMtime ){
727735
p = sortTreeByMtime(sTree.pFirst);
728736
memset(&sTree, 0, sizeof(sTree));
729737
relinkTree(&sTree, p);
730738
}
731739
for(p=sTree.pFirst, nDir=0; p; p=p->pNext){
@@ -998,25 +1006,27 @@
9981006
}
9991007
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid);
10001008
baseTime = db_double(0.0,"SELECT mtime FROM event WHERE objid=%d", rid);
10011009
zNow = db_text("", "SELECT datetime(mtime,'localtime') FROM event"
10021010
" 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);
10041013
style_header("File Ages");
10051014
zGlob = P("glob");
10061015
compute_fileage(rid,zGlob);
10071016
db_multi_exec("CREATE INDEX fileage_ix1 ON fileage(mid,pathname);");
10081017
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>
10181028
@
10191029
@ <div class='fileage'><table>
10201030
@ <tr><th>Time</th><th>Files</th><th>Checkin</th></tr>
10211031
db_prepare(&q1,
10221032
"SELECT event.mtime, event.objid, blob.uuid,\n"
10231033
--- 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

Keyboard Shortcuts

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