Fossil SCM

Back out the m2= query parameter for /timeline. Instead go back in and document the sel1= and sel2= query parameters. Note the subtle differences between m= and sel1=. Do not allow m=, or c=, or any other parameter to override sel1=.

drh 2021-07-12 18:37 trunk
Commit ee07556688c6c9383417e8402fa4f2be4d96afe9bff92ea1fd2849f74df3e8cc
1 file changed +14 -8
+14 -8
--- src/timeline.c
+++ src/timeline.c
@@ -1547,12 +1547,18 @@
15471547
** a=TIMEORTAG Show events after TIMEORTAG
15481548
** b=TIMEORTAG Show events before TIMEORTAG
15491549
** c=TIMEORTAG Show events that happen "circa" TIMEORTAG
15501550
** cf=FILEHASH Show events around the time of the first use of
15511551
** the file with FILEHASH
1552
-** m=TIMEORTAG Highlight the event at TIMEORTAG
1553
-** m2=TIMEORTAG Secondary highlight
1552
+** m=TIMEORTAG Highlight the event at TIMEORTAG, or the closest available
1553
+** event if TIMEORTAG is not part of the timeline. If
1554
+** the t= or r= is used, the m event is added to the timeline
1555
+** if it isn't there already.
1556
+** sel1=TIMEORTAG Highlight the check-in at TIMEORTAG if it is part of
1557
+** the timeline. Similar to m= except TIMEORTAG must
1558
+** match a check-in that is already in the timeline.
1559
+** sel2=TIMEORTAG Like sel1= but use the secondary highlight.
15541560
** n=COUNT Maximum number of events. "all" for no limit
15551561
** n1=COUNT Same as "n" but doesn't set the display-preference cookie
15561562
** Use "n1=COUNT" for a one-time display change
15571563
** p=CHECKIN Parents and ancestors of CHECKIN
15581564
** bt=PRIOR ... going back to PRIOR
@@ -1733,12 +1739,12 @@
17331739
}
17341740
17351741
/* Undocumented query parameter to set JS mode */
17361742
builtin_set_js_delivery_mode(P("jsmode"),1);
17371743
1738
- secondaryRid = name_to_typed_rid(cgi_coalesce("sel2","m2",NULL),"ci");
1739
- selectedRid = name_to_typed_rid(cgi_coalesce("m","sel1",NULL),"ci");
1744
+ secondaryRid = name_to_typed_rid(P("sel2"),"ci");
1745
+ selectedRid = name_to_typed_rid(P("sel1"),"ci");
17401746
tmFlags |= timeline_ss_submenu();
17411747
cookie_link_parameter("advm","advm","0");
17421748
advancedMenu = atoi(PD("advm","0"));
17431749
17441750
/* Omit all cherry-pick merge lines if the "ncp" query parameter is
@@ -2086,11 +2092,11 @@
20862092
nd = db_int(0, "SELECT count(*)-1 FROM ok");
20872093
if( nd>=0 ) db_multi_exec("%s", blob_sql_text(&sql));
20882094
if( nd>0 || p_rid==0 ){
20892095
blob_appendf(&desc, "%d descendant%s", nd,(1==nd)?"":"s");
20902096
}
2091
- if( useDividers ) selectedRid = d_rid;
2097
+ if( useDividers && !selectedRid ) selectedRid = d_rid;
20922098
db_multi_exec("DELETE FROM ok");
20932099
}
20942100
if( p_rid ){
20952101
zBackTo = P("bt");
20962102
ridBackTo = zBackTo ? name_to_typed_rid(zBackTo,"ci") : 0;
@@ -2100,11 +2106,11 @@
21002106
if( np>0 || nd==0 ){
21012107
if( nd>0 ) blob_appendf(&desc, " and ");
21022108
blob_appendf(&desc, "%d ancestor%s", np, (1==np)?"":"s");
21032109
db_multi_exec("%s", blob_sql_text(&sql));
21042110
}
2105
- if( useDividers ) selectedRid = p_rid;
2111
+ if( useDividers && !selectedRid ) selectedRid = p_rid;
21062112
}
21072113
21082114
blob_appendf(&desc, " of %z%h</a>",
21092115
href("%R/info?name=%h", zCiName), zCiName);
21102116
if( ridBackTo ){
@@ -2149,11 +2155,11 @@
21492155
f_rid, f_rid
21502156
);
21512157
}
21522158
blob_append_sql(&sql, " AND event.objid IN ok");
21532159
db_multi_exec("%s", blob_sql_text(&sql));
2154
- if( useDividers ) selectedRid = f_rid;
2160
+ if( useDividers && !selectedRid ) selectedRid = f_rid;
21552161
blob_appendf(&desc, "Parents and children of check-in ");
21562162
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
21572163
blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid);
21582164
tmFlags |= TIMELINE_XMERGE;
21592165
if( advancedMenu ){
@@ -2643,11 +2649,11 @@
26432649
url_render(&url, "advm", "1", "udc", "1"));
26442650
}
26452651
if( PB("showid") ) tmFlags |= TIMELINE_SHOWRID;
26462652
if( useDividers && zMark && zMark[0] ){
26472653
double r = symbolic_name_to_mtime(zMark, 0);
2648
- if( r>0.0 ) selectedRid = timeline_add_divider(r);
2654
+ if( r>0.0 && !selectedRid ) selectedRid = timeline_add_divider(r);
26492655
}
26502656
blob_zero(&sql);
26512657
db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
26522658
if( fossil_islower(desc.aData[0]) ){
26532659
desc.aData[0] = fossil_toupper(desc.aData[0]);
26542660
--- src/timeline.c
+++ src/timeline.c
@@ -1547,12 +1547,18 @@
1547 ** a=TIMEORTAG Show events after TIMEORTAG
1548 ** b=TIMEORTAG Show events before TIMEORTAG
1549 ** c=TIMEORTAG Show events that happen "circa" TIMEORTAG
1550 ** cf=FILEHASH Show events around the time of the first use of
1551 ** the file with FILEHASH
1552 ** m=TIMEORTAG Highlight the event at TIMEORTAG
1553 ** m2=TIMEORTAG Secondary highlight
 
 
 
 
 
 
1554 ** n=COUNT Maximum number of events. "all" for no limit
1555 ** n1=COUNT Same as "n" but doesn't set the display-preference cookie
1556 ** Use "n1=COUNT" for a one-time display change
1557 ** p=CHECKIN Parents and ancestors of CHECKIN
1558 ** bt=PRIOR ... going back to PRIOR
@@ -1733,12 +1739,12 @@
1733 }
1734
1735 /* Undocumented query parameter to set JS mode */
1736 builtin_set_js_delivery_mode(P("jsmode"),1);
1737
1738 secondaryRid = name_to_typed_rid(cgi_coalesce("sel2","m2",NULL),"ci");
1739 selectedRid = name_to_typed_rid(cgi_coalesce("m","sel1",NULL),"ci");
1740 tmFlags |= timeline_ss_submenu();
1741 cookie_link_parameter("advm","advm","0");
1742 advancedMenu = atoi(PD("advm","0"));
1743
1744 /* Omit all cherry-pick merge lines if the "ncp" query parameter is
@@ -2086,11 +2092,11 @@
2086 nd = db_int(0, "SELECT count(*)-1 FROM ok");
2087 if( nd>=0 ) db_multi_exec("%s", blob_sql_text(&sql));
2088 if( nd>0 || p_rid==0 ){
2089 blob_appendf(&desc, "%d descendant%s", nd,(1==nd)?"":"s");
2090 }
2091 if( useDividers ) selectedRid = d_rid;
2092 db_multi_exec("DELETE FROM ok");
2093 }
2094 if( p_rid ){
2095 zBackTo = P("bt");
2096 ridBackTo = zBackTo ? name_to_typed_rid(zBackTo,"ci") : 0;
@@ -2100,11 +2106,11 @@
2100 if( np>0 || nd==0 ){
2101 if( nd>0 ) blob_appendf(&desc, " and ");
2102 blob_appendf(&desc, "%d ancestor%s", np, (1==np)?"":"s");
2103 db_multi_exec("%s", blob_sql_text(&sql));
2104 }
2105 if( useDividers ) selectedRid = p_rid;
2106 }
2107
2108 blob_appendf(&desc, " of %z%h</a>",
2109 href("%R/info?name=%h", zCiName), zCiName);
2110 if( ridBackTo ){
@@ -2149,11 +2155,11 @@
2149 f_rid, f_rid
2150 );
2151 }
2152 blob_append_sql(&sql, " AND event.objid IN ok");
2153 db_multi_exec("%s", blob_sql_text(&sql));
2154 if( useDividers ) selectedRid = f_rid;
2155 blob_appendf(&desc, "Parents and children of check-in ");
2156 zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
2157 blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid);
2158 tmFlags |= TIMELINE_XMERGE;
2159 if( advancedMenu ){
@@ -2643,11 +2649,11 @@
2643 url_render(&url, "advm", "1", "udc", "1"));
2644 }
2645 if( PB("showid") ) tmFlags |= TIMELINE_SHOWRID;
2646 if( useDividers && zMark && zMark[0] ){
2647 double r = symbolic_name_to_mtime(zMark, 0);
2648 if( r>0.0 ) selectedRid = timeline_add_divider(r);
2649 }
2650 blob_zero(&sql);
2651 db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
2652 if( fossil_islower(desc.aData[0]) ){
2653 desc.aData[0] = fossil_toupper(desc.aData[0]);
2654
--- src/timeline.c
+++ src/timeline.c
@@ -1547,12 +1547,18 @@
1547 ** a=TIMEORTAG Show events after TIMEORTAG
1548 ** b=TIMEORTAG Show events before TIMEORTAG
1549 ** c=TIMEORTAG Show events that happen "circa" TIMEORTAG
1550 ** cf=FILEHASH Show events around the time of the first use of
1551 ** the file with FILEHASH
1552 ** m=TIMEORTAG Highlight the event at TIMEORTAG, or the closest available
1553 ** event if TIMEORTAG is not part of the timeline. If
1554 ** the t= or r= is used, the m event is added to the timeline
1555 ** if it isn't there already.
1556 ** sel1=TIMEORTAG Highlight the check-in at TIMEORTAG if it is part of
1557 ** the timeline. Similar to m= except TIMEORTAG must
1558 ** match a check-in that is already in the timeline.
1559 ** sel2=TIMEORTAG Like sel1= but use the secondary highlight.
1560 ** n=COUNT Maximum number of events. "all" for no limit
1561 ** n1=COUNT Same as "n" but doesn't set the display-preference cookie
1562 ** Use "n1=COUNT" for a one-time display change
1563 ** p=CHECKIN Parents and ancestors of CHECKIN
1564 ** bt=PRIOR ... going back to PRIOR
@@ -1733,12 +1739,12 @@
1739 }
1740
1741 /* Undocumented query parameter to set JS mode */
1742 builtin_set_js_delivery_mode(P("jsmode"),1);
1743
1744 secondaryRid = name_to_typed_rid(P("sel2"),"ci");
1745 selectedRid = name_to_typed_rid(P("sel1"),"ci");
1746 tmFlags |= timeline_ss_submenu();
1747 cookie_link_parameter("advm","advm","0");
1748 advancedMenu = atoi(PD("advm","0"));
1749
1750 /* Omit all cherry-pick merge lines if the "ncp" query parameter is
@@ -2086,11 +2092,11 @@
2092 nd = db_int(0, "SELECT count(*)-1 FROM ok");
2093 if( nd>=0 ) db_multi_exec("%s", blob_sql_text(&sql));
2094 if( nd>0 || p_rid==0 ){
2095 blob_appendf(&desc, "%d descendant%s", nd,(1==nd)?"":"s");
2096 }
2097 if( useDividers && !selectedRid ) selectedRid = d_rid;
2098 db_multi_exec("DELETE FROM ok");
2099 }
2100 if( p_rid ){
2101 zBackTo = P("bt");
2102 ridBackTo = zBackTo ? name_to_typed_rid(zBackTo,"ci") : 0;
@@ -2100,11 +2106,11 @@
2106 if( np>0 || nd==0 ){
2107 if( nd>0 ) blob_appendf(&desc, " and ");
2108 blob_appendf(&desc, "%d ancestor%s", np, (1==np)?"":"s");
2109 db_multi_exec("%s", blob_sql_text(&sql));
2110 }
2111 if( useDividers && !selectedRid ) selectedRid = p_rid;
2112 }
2113
2114 blob_appendf(&desc, " of %z%h</a>",
2115 href("%R/info?name=%h", zCiName), zCiName);
2116 if( ridBackTo ){
@@ -2149,11 +2155,11 @@
2155 f_rid, f_rid
2156 );
2157 }
2158 blob_append_sql(&sql, " AND event.objid IN ok");
2159 db_multi_exec("%s", blob_sql_text(&sql));
2160 if( useDividers && !selectedRid ) selectedRid = f_rid;
2161 blob_appendf(&desc, "Parents and children of check-in ");
2162 zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
2163 blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid);
2164 tmFlags |= TIMELINE_XMERGE;
2165 if( advancedMenu ){
@@ -2643,11 +2649,11 @@
2649 url_render(&url, "advm", "1", "udc", "1"));
2650 }
2651 if( PB("showid") ) tmFlags |= TIMELINE_SHOWRID;
2652 if( useDividers && zMark && zMark[0] ){
2653 double r = symbolic_name_to_mtime(zMark, 0);
2654 if( r>0.0 && !selectedRid ) selectedRid = timeline_add_divider(r);
2655 }
2656 blob_zero(&sql);
2657 db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
2658 if( fossil_islower(desc.aData[0]) ){
2659 desc.aData[0] = fossil_toupper(desc.aData[0]);
2660

Keyboard Shortcuts

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