Fossil SCM

The n1=COUNT query parameter on /timeline is a one-time count that does not affect the display preferences cookie.

drh 2020-12-31 14:06 trunk
Commit cd892ac335ebd4886494608910b85cae29c87e0948ec9f9255b579e596e8160e
1 file changed +18 -16
+18 -16
--- src/timeline.c
+++ src/timeline.c
@@ -1636,12 +1636,12 @@
16361636
** c=TIMEORTAG Show events that happen "circa" TIMEORTAG
16371637
** cf=FILEHASH Show events around the time of the first use of
16381638
** the file with FILEHASH
16391639
** m=TIMEORTAG Highlight the event at TIMEORTAG
16401640
** 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
16431643
** p=CHECKIN Parents and ancestors of CHECKIN
16441644
** bt=PRIOR ... going back to PRIOR
16451645
** d=CHECKIN Children and descendants of CHECKIN
16461646
** dp=CHECKIN The same as 'd=CHECKIN&p=CHECKIN'
16471647
** t=TAG Show only check-ins with the given TAG
@@ -1762,21 +1762,25 @@
17621762
17631763
/* Set number of rows to display */
17641764
z = P("n");
17651765
if( z!=0 ){
17661766
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;
17781782
}
17791783
}
17801784
if( z ){
17811785
if( fossil_strcmp(z,"all")==0 ){
17821786
nEntry = 0;
@@ -1795,12 +1799,10 @@
17951799
/* Undocumented query parameter to set JS mode */
17961800
builtin_set_js_delivery_mode(P("jsmode"),1);
17971801
17981802
secondaryRid = name_to_typed_rid(P("sel2"),"ci");
17991803
selectedRid = name_to_typed_rid(P("sel1"),"ci");
1800
- cgi_replace_query_parameter("n",z);
1801
- cookie_write_parameter("n","n",0);
18021804
tmFlags |= timeline_ss_submenu();
18031805
cookie_link_parameter("advm","advm","0");
18041806
advancedMenu = atoi(PD("advm","0"));
18051807
18061808
/* Omit all cherry-pick merge lines if the "ncp" query parameter is
@@ -2128,11 +2130,11 @@
21282130
int ridBackTo = 0;
21292131
21302132
tmFlags |= TIMELINE_XMERGE | TIMELINE_FILLGAPS;
21312133
if( p_rid && d_rid ){
21322134
if( p_rid!=d_rid ) p_rid = d_rid;
2133
- if( P("n")==0 ) nEntry = 10;
2135
+ if( !haveParameterN ) nEntry = 10;
21342136
}
21352137
db_multi_exec(
21362138
"CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY)"
21372139
);
21382140
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d",
21392141
--- 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

Keyboard Shortcuts

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