Fossil SCM
The n1=COUNT query parameter on /timeline is a one-time count that does not affect the display preferences cookie.
Commit
cd892ac335ebd4886494608910b85cae29c87e0948ec9f9255b579e596e8160e
Parent
dffcebea147aa88…
1 file changed
+18
-16
+18
-16
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1636,12 +1636,12 @@ | ||
| 1636 | 1636 | ** c=TIMEORTAG Show events that happen "circa" TIMEORTAG |
| 1637 | 1637 | ** cf=FILEHASH Show events around the time of the first use of |
| 1638 | 1638 | ** the file with FILEHASH |
| 1639 | 1639 | ** m=TIMEORTAG Highlight the event at TIMEORTAG |
| 1640 | 1640 | ** n=COUNT Maximum number of events. "all" for no limit |
| 1641 | -** n1=COUNT Same as "n" but does not set the user-preference cookie | |
| 1642 | -** Use "n1=COUNT" for a one-time display | |
| 1641 | +** n1=COUNT Same as "n" but doesn't set the display-preference cookie | |
| 1642 | +** Use "n1=COUNT" for a one-time display change | |
| 1643 | 1643 | ** p=CHECKIN Parents and ancestors of CHECKIN |
| 1644 | 1644 | ** bt=PRIOR ... going back to PRIOR |
| 1645 | 1645 | ** d=CHECKIN Children and descendants of CHECKIN |
| 1646 | 1646 | ** dp=CHECKIN The same as 'd=CHECKIN&p=CHECKIN' |
| 1647 | 1647 | ** t=TAG Show only check-ins with the given TAG |
| @@ -1762,21 +1762,25 @@ | ||
| 1762 | 1762 | |
| 1763 | 1763 | /* Set number of rows to display */ |
| 1764 | 1764 | z = P("n"); |
| 1765 | 1765 | if( z!=0 ){ |
| 1766 | 1766 | haveParameterN = 1; |
| 1767 | - }else{ | |
| 1768 | - z = P("n1"); | |
| 1769 | - if( z ){ | |
| 1770 | - haveParameterN = 1; | |
| 1771 | - }else{ | |
| 1772 | - haveParameterN = 0; | |
| 1773 | - cookie_read_parameter("n","n"); | |
| 1774 | - z = P("n"); | |
| 1775 | - if( z==0 ){ | |
| 1776 | - z = db_get("timeline-default-length",0); | |
| 1777 | - } | |
| 1767 | + cookie_write_parameter("n","n",0); | |
| 1768 | + }else{ | |
| 1769 | + const char *z2; | |
| 1770 | + haveParameterN = 0; | |
| 1771 | + cookie_read_parameter("n","n"); | |
| 1772 | + z = P("n"); | |
| 1773 | + if( z==0 ){ | |
| 1774 | + z = db_get("timeline-default-length",0); | |
| 1775 | + } | |
| 1776 | + cgi_replace_query_parameter("n",z); | |
| 1777 | + cookie_write_parameter("n","n",0); | |
| 1778 | + z2 = P("n1"); | |
| 1779 | + if( z2 ){ | |
| 1780 | + haveParameterN = 2; | |
| 1781 | + z = z2; | |
| 1778 | 1782 | } |
| 1779 | 1783 | } |
| 1780 | 1784 | if( z ){ |
| 1781 | 1785 | if( fossil_strcmp(z,"all")==0 ){ |
| 1782 | 1786 | nEntry = 0; |
| @@ -1795,12 +1799,10 @@ | ||
| 1795 | 1799 | /* Undocumented query parameter to set JS mode */ |
| 1796 | 1800 | builtin_set_js_delivery_mode(P("jsmode"),1); |
| 1797 | 1801 | |
| 1798 | 1802 | secondaryRid = name_to_typed_rid(P("sel2"),"ci"); |
| 1799 | 1803 | selectedRid = name_to_typed_rid(P("sel1"),"ci"); |
| 1800 | - cgi_replace_query_parameter("n",z); | |
| 1801 | - cookie_write_parameter("n","n",0); | |
| 1802 | 1804 | tmFlags |= timeline_ss_submenu(); |
| 1803 | 1805 | cookie_link_parameter("advm","advm","0"); |
| 1804 | 1806 | advancedMenu = atoi(PD("advm","0")); |
| 1805 | 1807 | |
| 1806 | 1808 | /* Omit all cherry-pick merge lines if the "ncp" query parameter is |
| @@ -2128,11 +2130,11 @@ | ||
| 2128 | 2130 | int ridBackTo = 0; |
| 2129 | 2131 | |
| 2130 | 2132 | tmFlags |= TIMELINE_XMERGE | TIMELINE_FILLGAPS; |
| 2131 | 2133 | if( p_rid && d_rid ){ |
| 2132 | 2134 | if( p_rid!=d_rid ) p_rid = d_rid; |
| 2133 | - if( P("n")==0 ) nEntry = 10; | |
| 2135 | + if( !haveParameterN ) nEntry = 10; | |
| 2134 | 2136 | } |
| 2135 | 2137 | db_multi_exec( |
| 2136 | 2138 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY)" |
| 2137 | 2139 | ); |
| 2138 | 2140 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", |
| 2139 | 2141 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1636,12 +1636,12 @@ | |
| 1636 | ** c=TIMEORTAG Show events that happen "circa" TIMEORTAG |
| 1637 | ** cf=FILEHASH Show events around the time of the first use of |
| 1638 | ** the file with FILEHASH |
| 1639 | ** m=TIMEORTAG Highlight the event at TIMEORTAG |
| 1640 | ** n=COUNT Maximum number of events. "all" for no limit |
| 1641 | ** n1=COUNT Same as "n" but does not set the user-preference cookie |
| 1642 | ** Use "n1=COUNT" for a one-time display |
| 1643 | ** p=CHECKIN Parents and ancestors of CHECKIN |
| 1644 | ** bt=PRIOR ... going back to PRIOR |
| 1645 | ** d=CHECKIN Children and descendants of CHECKIN |
| 1646 | ** dp=CHECKIN The same as 'd=CHECKIN&p=CHECKIN' |
| 1647 | ** t=TAG Show only check-ins with the given TAG |
| @@ -1762,21 +1762,25 @@ | |
| 1762 | |
| 1763 | /* Set number of rows to display */ |
| 1764 | z = P("n"); |
| 1765 | if( z!=0 ){ |
| 1766 | haveParameterN = 1; |
| 1767 | }else{ |
| 1768 | z = P("n1"); |
| 1769 | if( z ){ |
| 1770 | haveParameterN = 1; |
| 1771 | }else{ |
| 1772 | haveParameterN = 0; |
| 1773 | cookie_read_parameter("n","n"); |
| 1774 | z = P("n"); |
| 1775 | if( z==0 ){ |
| 1776 | z = db_get("timeline-default-length",0); |
| 1777 | } |
| 1778 | } |
| 1779 | } |
| 1780 | if( z ){ |
| 1781 | if( fossil_strcmp(z,"all")==0 ){ |
| 1782 | nEntry = 0; |
| @@ -1795,12 +1799,10 @@ | |
| 1795 | /* Undocumented query parameter to set JS mode */ |
| 1796 | builtin_set_js_delivery_mode(P("jsmode"),1); |
| 1797 | |
| 1798 | secondaryRid = name_to_typed_rid(P("sel2"),"ci"); |
| 1799 | selectedRid = name_to_typed_rid(P("sel1"),"ci"); |
| 1800 | cgi_replace_query_parameter("n",z); |
| 1801 | cookie_write_parameter("n","n",0); |
| 1802 | tmFlags |= timeline_ss_submenu(); |
| 1803 | cookie_link_parameter("advm","advm","0"); |
| 1804 | advancedMenu = atoi(PD("advm","0")); |
| 1805 | |
| 1806 | /* Omit all cherry-pick merge lines if the "ncp" query parameter is |
| @@ -2128,11 +2130,11 @@ | |
| 2128 | int ridBackTo = 0; |
| 2129 | |
| 2130 | tmFlags |= TIMELINE_XMERGE | TIMELINE_FILLGAPS; |
| 2131 | if( p_rid && d_rid ){ |
| 2132 | if( p_rid!=d_rid ) p_rid = d_rid; |
| 2133 | if( P("n")==0 ) nEntry = 10; |
| 2134 | } |
| 2135 | db_multi_exec( |
| 2136 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY)" |
| 2137 | ); |
| 2138 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", |
| 2139 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1636,12 +1636,12 @@ | |
| 1636 | ** c=TIMEORTAG Show events that happen "circa" TIMEORTAG |
| 1637 | ** cf=FILEHASH Show events around the time of the first use of |
| 1638 | ** the file with FILEHASH |
| 1639 | ** m=TIMEORTAG Highlight the event at TIMEORTAG |
| 1640 | ** n=COUNT Maximum number of events. "all" for no limit |
| 1641 | ** n1=COUNT Same as "n" but doesn't set the display-preference cookie |
| 1642 | ** Use "n1=COUNT" for a one-time display change |
| 1643 | ** p=CHECKIN Parents and ancestors of CHECKIN |
| 1644 | ** bt=PRIOR ... going back to PRIOR |
| 1645 | ** d=CHECKIN Children and descendants of CHECKIN |
| 1646 | ** dp=CHECKIN The same as 'd=CHECKIN&p=CHECKIN' |
| 1647 | ** t=TAG Show only check-ins with the given TAG |
| @@ -1762,21 +1762,25 @@ | |
| 1762 | |
| 1763 | /* Set number of rows to display */ |
| 1764 | z = P("n"); |
| 1765 | if( z!=0 ){ |
| 1766 | haveParameterN = 1; |
| 1767 | cookie_write_parameter("n","n",0); |
| 1768 | }else{ |
| 1769 | const char *z2; |
| 1770 | haveParameterN = 0; |
| 1771 | cookie_read_parameter("n","n"); |
| 1772 | z = P("n"); |
| 1773 | if( z==0 ){ |
| 1774 | z = db_get("timeline-default-length",0); |
| 1775 | } |
| 1776 | cgi_replace_query_parameter("n",z); |
| 1777 | cookie_write_parameter("n","n",0); |
| 1778 | z2 = P("n1"); |
| 1779 | if( z2 ){ |
| 1780 | haveParameterN = 2; |
| 1781 | z = z2; |
| 1782 | } |
| 1783 | } |
| 1784 | if( z ){ |
| 1785 | if( fossil_strcmp(z,"all")==0 ){ |
| 1786 | nEntry = 0; |
| @@ -1795,12 +1799,10 @@ | |
| 1799 | /* Undocumented query parameter to set JS mode */ |
| 1800 | builtin_set_js_delivery_mode(P("jsmode"),1); |
| 1801 | |
| 1802 | secondaryRid = name_to_typed_rid(P("sel2"),"ci"); |
| 1803 | selectedRid = name_to_typed_rid(P("sel1"),"ci"); |
| 1804 | tmFlags |= timeline_ss_submenu(); |
| 1805 | cookie_link_parameter("advm","advm","0"); |
| 1806 | advancedMenu = atoi(PD("advm","0")); |
| 1807 | |
| 1808 | /* Omit all cherry-pick merge lines if the "ncp" query parameter is |
| @@ -2128,11 +2130,11 @@ | |
| 2130 | int ridBackTo = 0; |
| 2131 | |
| 2132 | tmFlags |= TIMELINE_XMERGE | TIMELINE_FILLGAPS; |
| 2133 | if( p_rid && d_rid ){ |
| 2134 | if( p_rid!=d_rid ) p_rid = d_rid; |
| 2135 | if( !haveParameterN ) nEntry = 10; |
| 2136 | } |
| 2137 | db_multi_exec( |
| 2138 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY)" |
| 2139 | ); |
| 2140 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", |
| 2141 |