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=.
Commit
ee07556688c6c9383417e8402fa4f2be4d96afe9bff92ea1fd2849f74df3e8cc
Parent
3fa951bb45c506e…
1 file changed
+14
-8
+14
-8
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1547,12 +1547,18 @@ | ||
| 1547 | 1547 | ** a=TIMEORTAG Show events after TIMEORTAG |
| 1548 | 1548 | ** b=TIMEORTAG Show events before TIMEORTAG |
| 1549 | 1549 | ** c=TIMEORTAG Show events that happen "circa" TIMEORTAG |
| 1550 | 1550 | ** cf=FILEHASH Show events around the time of the first use of |
| 1551 | 1551 | ** 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. | |
| 1554 | 1560 | ** n=COUNT Maximum number of events. "all" for no limit |
| 1555 | 1561 | ** n1=COUNT Same as "n" but doesn't set the display-preference cookie |
| 1556 | 1562 | ** Use "n1=COUNT" for a one-time display change |
| 1557 | 1563 | ** p=CHECKIN Parents and ancestors of CHECKIN |
| 1558 | 1564 | ** bt=PRIOR ... going back to PRIOR |
| @@ -1733,12 +1739,12 @@ | ||
| 1733 | 1739 | } |
| 1734 | 1740 | |
| 1735 | 1741 | /* Undocumented query parameter to set JS mode */ |
| 1736 | 1742 | builtin_set_js_delivery_mode(P("jsmode"),1); |
| 1737 | 1743 | |
| 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"); | |
| 1740 | 1746 | tmFlags |= timeline_ss_submenu(); |
| 1741 | 1747 | cookie_link_parameter("advm","advm","0"); |
| 1742 | 1748 | advancedMenu = atoi(PD("advm","0")); |
| 1743 | 1749 | |
| 1744 | 1750 | /* Omit all cherry-pick merge lines if the "ncp" query parameter is |
| @@ -2086,11 +2092,11 @@ | ||
| 2086 | 2092 | nd = db_int(0, "SELECT count(*)-1 FROM ok"); |
| 2087 | 2093 | if( nd>=0 ) db_multi_exec("%s", blob_sql_text(&sql)); |
| 2088 | 2094 | if( nd>0 || p_rid==0 ){ |
| 2089 | 2095 | blob_appendf(&desc, "%d descendant%s", nd,(1==nd)?"":"s"); |
| 2090 | 2096 | } |
| 2091 | - if( useDividers ) selectedRid = d_rid; | |
| 2097 | + if( useDividers && !selectedRid ) selectedRid = d_rid; | |
| 2092 | 2098 | db_multi_exec("DELETE FROM ok"); |
| 2093 | 2099 | } |
| 2094 | 2100 | if( p_rid ){ |
| 2095 | 2101 | zBackTo = P("bt"); |
| 2096 | 2102 | ridBackTo = zBackTo ? name_to_typed_rid(zBackTo,"ci") : 0; |
| @@ -2100,11 +2106,11 @@ | ||
| 2100 | 2106 | if( np>0 || nd==0 ){ |
| 2101 | 2107 | if( nd>0 ) blob_appendf(&desc, " and "); |
| 2102 | 2108 | blob_appendf(&desc, "%d ancestor%s", np, (1==np)?"":"s"); |
| 2103 | 2109 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 2104 | 2110 | } |
| 2105 | - if( useDividers ) selectedRid = p_rid; | |
| 2111 | + if( useDividers && !selectedRid ) selectedRid = p_rid; | |
| 2106 | 2112 | } |
| 2107 | 2113 | |
| 2108 | 2114 | blob_appendf(&desc, " of %z%h</a>", |
| 2109 | 2115 | href("%R/info?name=%h", zCiName), zCiName); |
| 2110 | 2116 | if( ridBackTo ){ |
| @@ -2149,11 +2155,11 @@ | ||
| 2149 | 2155 | f_rid, f_rid |
| 2150 | 2156 | ); |
| 2151 | 2157 | } |
| 2152 | 2158 | blob_append_sql(&sql, " AND event.objid IN ok"); |
| 2153 | 2159 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 2154 | - if( useDividers ) selectedRid = f_rid; | |
| 2160 | + if( useDividers && !selectedRid ) selectedRid = f_rid; | |
| 2155 | 2161 | blob_appendf(&desc, "Parents and children of check-in "); |
| 2156 | 2162 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 2157 | 2163 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 2158 | 2164 | tmFlags |= TIMELINE_XMERGE; |
| 2159 | 2165 | if( advancedMenu ){ |
| @@ -2643,11 +2649,11 @@ | ||
| 2643 | 2649 | url_render(&url, "advm", "1", "udc", "1")); |
| 2644 | 2650 | } |
| 2645 | 2651 | if( PB("showid") ) tmFlags |= TIMELINE_SHOWRID; |
| 2646 | 2652 | if( useDividers && zMark && zMark[0] ){ |
| 2647 | 2653 | 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); | |
| 2649 | 2655 | } |
| 2650 | 2656 | blob_zero(&sql); |
| 2651 | 2657 | db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/"); |
| 2652 | 2658 | if( fossil_islower(desc.aData[0]) ){ |
| 2653 | 2659 | desc.aData[0] = fossil_toupper(desc.aData[0]); |
| 2654 | 2660 |
| --- 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 |