Fossil SCM

Add the "current_checkout" variable to TH1 prior to running style_header() on some pages. The default skin uses this variable to adjust the meaning of the "File" menu option.

drh 2020-05-13 11:47 trunk merge
Commit 78abc282df14f3b4aefc211a433bfd3a11524477ef1e3a908397a39ef9481e1e
--- skins/default/header.txt
+++ skins/default/header.txt
@@ -23,11 +23,12 @@
2323
menulink $index_page Home {}
2424
if {[anycap jor]} {
2525
menulink /timeline Timeline {}
2626
}
2727
if {[hascap oh]} {
28
- menulink /dir?ci=tip Files desktoponly
28
+ if {![info exists current_checkin]} {set current_checkin tip}
29
+ menulink /dir?ci=$current_checkin Files desktoponly
2930
}
3031
if {[hascap o]} {
3132
menulink /brlist Branches desktoponly
3233
menulink /taglist Tags wideonly
3334
}
3435
--- skins/default/header.txt
+++ skins/default/header.txt
@@ -23,11 +23,12 @@
23 menulink $index_page Home {}
24 if {[anycap jor]} {
25 menulink /timeline Timeline {}
26 }
27 if {[hascap oh]} {
28 menulink /dir?ci=tip Files desktoponly
 
29 }
30 if {[hascap o]} {
31 menulink /brlist Branches desktoponly
32 menulink /taglist Tags wideonly
33 }
34
--- skins/default/header.txt
+++ skins/default/header.txt
@@ -23,11 +23,12 @@
23 menulink $index_page Home {}
24 if {[anycap jor]} {
25 menulink /timeline Timeline {}
26 }
27 if {[hascap oh]} {
28 if {![info exists current_checkin]} {set current_checkin tip}
29 menulink /dir?ci=$current_checkin Files desktoponly
30 }
31 if {[hascap o]} {
32 menulink /brlist Branches desktoponly
33 menulink /taglist Tags wideonly
34 }
35
--- src/browse.c
+++ src/browse.c
@@ -173,10 +173,11 @@
173173
linkTrunk = trunkRid && rid != trunkRid;
174174
linkTip = rid != symbolic_name_to_rid("tip", "ci");
175175
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
176176
isSymbolicCI = (sqlite3_strnicmp(zUuid, zCI, strlen(zCI))!=0);
177177
isBranchCI = branch_includes_uuid(zCI, zUuid);
178
+ Th_Store("current_checkin", zCI);
178179
}else{
179180
zCI = 0;
180181
}
181182
}
182183
@@ -701,10 +702,11 @@
701702
rNow = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid);
702703
zNow = db_text("", "SELECT datetime(mtime,toLocal())"
703704
" FROM event WHERE objid=%d", rid);
704705
isSymbolicCI = (sqlite3_strnicmp(zUuid, zCI, strlen(zCI)) != 0);
705706
isBranchCI = branch_includes_uuid(zCI, zUuid);
707
+ Th_Store("current_checkin", zCI);
706708
}else{
707709
zCI = 0;
708710
}
709711
}
710712
if( zCI==0 ){
711713
--- src/browse.c
+++ src/browse.c
@@ -173,10 +173,11 @@
173 linkTrunk = trunkRid && rid != trunkRid;
174 linkTip = rid != symbolic_name_to_rid("tip", "ci");
175 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
176 isSymbolicCI = (sqlite3_strnicmp(zUuid, zCI, strlen(zCI))!=0);
177 isBranchCI = branch_includes_uuid(zCI, zUuid);
 
178 }else{
179 zCI = 0;
180 }
181 }
182
@@ -701,10 +702,11 @@
701 rNow = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid);
702 zNow = db_text("", "SELECT datetime(mtime,toLocal())"
703 " FROM event WHERE objid=%d", rid);
704 isSymbolicCI = (sqlite3_strnicmp(zUuid, zCI, strlen(zCI)) != 0);
705 isBranchCI = branch_includes_uuid(zCI, zUuid);
 
706 }else{
707 zCI = 0;
708 }
709 }
710 if( zCI==0 ){
711
--- src/browse.c
+++ src/browse.c
@@ -173,10 +173,11 @@
173 linkTrunk = trunkRid && rid != trunkRid;
174 linkTip = rid != symbolic_name_to_rid("tip", "ci");
175 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
176 isSymbolicCI = (sqlite3_strnicmp(zUuid, zCI, strlen(zCI))!=0);
177 isBranchCI = branch_includes_uuid(zCI, zUuid);
178 Th_Store("current_checkin", zCI);
179 }else{
180 zCI = 0;
181 }
182 }
183
@@ -701,10 +702,11 @@
702 rNow = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid);
703 zNow = db_text("", "SELECT datetime(mtime,toLocal())"
704 " FROM event WHERE objid=%d", rid);
705 isSymbolicCI = (sqlite3_strnicmp(zUuid, zCI, strlen(zCI)) != 0);
706 isBranchCI = branch_includes_uuid(zCI, zUuid);
707 Th_Store("current_checkin", zCI);
708 }else{
709 zCI = 0;
710 }
711 }
712 if( zCI==0 ){
713
+1
--- src/info.c
+++ src/info.c
@@ -666,10 +666,11 @@
666666
const char *zOrigDate;
667667
int okWiki = 0;
668668
Blob wiki_read_links = BLOB_INITIALIZER;
669669
Blob wiki_add_links = BLOB_INITIALIZER;
670670
671
+ Th_Store("current_checkin", zName);
671672
style_header("Check-in [%S]", zUuid);
672673
login_anonymous_available();
673674
zEUser = db_text(0,
674675
"SELECT value FROM tagxref"
675676
" WHERE tagid=%d AND rid=%d AND tagtype>0",
676677
--- src/info.c
+++ src/info.c
@@ -666,10 +666,11 @@
666 const char *zOrigDate;
667 int okWiki = 0;
668 Blob wiki_read_links = BLOB_INITIALIZER;
669 Blob wiki_add_links = BLOB_INITIALIZER;
670
 
671 style_header("Check-in [%S]", zUuid);
672 login_anonymous_available();
673 zEUser = db_text(0,
674 "SELECT value FROM tagxref"
675 " WHERE tagid=%d AND rid=%d AND tagtype>0",
676
--- src/info.c
+++ src/info.c
@@ -666,10 +666,11 @@
666 const char *zOrigDate;
667 int okWiki = 0;
668 Blob wiki_read_links = BLOB_INITIALIZER;
669 Blob wiki_add_links = BLOB_INITIALIZER;
670
671 Th_Store("current_checkin", zName);
672 style_header("Check-in [%S]", zUuid);
673 login_anonymous_available();
674 zEUser = db_text(0,
675 "SELECT value FROM tagxref"
676 " WHERE tagid=%d AND rid=%d AND tagtype>0",
677
--- src/timeline.c
+++ src/timeline.c
@@ -1796,10 +1796,11 @@
17961796
}else if( fossil_stricmp(zMatchStyle, "regexp")==0 ){
17971797
matchStyle = MS_REGEXP;
17981798
}else{
17991799
/* For exact maching, inhibit links to the selected tag. */
18001800
zThisTag = zTagName;
1801
+ Th_Store("current_checkin", zTagName);
18011802
}
18021803
18031804
/* Display a checkbox to enable/disable display of related check-ins. */
18041805
if( advancedMenu ){
18051806
style_submenu_checkbox("rel", "Related", 0, 0);
18061807
--- src/timeline.c
+++ src/timeline.c
@@ -1796,10 +1796,11 @@
1796 }else if( fossil_stricmp(zMatchStyle, "regexp")==0 ){
1797 matchStyle = MS_REGEXP;
1798 }else{
1799 /* For exact maching, inhibit links to the selected tag. */
1800 zThisTag = zTagName;
 
1801 }
1802
1803 /* Display a checkbox to enable/disable display of related check-ins. */
1804 if( advancedMenu ){
1805 style_submenu_checkbox("rel", "Related", 0, 0);
1806
--- src/timeline.c
+++ src/timeline.c
@@ -1796,10 +1796,11 @@
1796 }else if( fossil_stricmp(zMatchStyle, "regexp")==0 ){
1797 matchStyle = MS_REGEXP;
1798 }else{
1799 /* For exact maching, inhibit links to the selected tag. */
1800 zThisTag = zTagName;
1801 Th_Store("current_checkin", zTagName);
1802 }
1803
1804 /* Display a checkbox to enable/disable display of related check-ins. */
1805 if( advancedMenu ){
1806 style_submenu_checkbox("rel", "Related", 0, 0);
1807

Keyboard Shortcuts

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