Fossil SCM

Add the d2=, p2=, and dp2= query parameters to /timeline.

drh 2024-05-08 12:27 trunk
Commit a080751e5c370833dd72f894059315134ecb332f40496be2bed1527161c35201
1 file changed +8 -6
+8 -6
--- src/timeline.c
+++ src/timeline.c
@@ -1718,13 +1718,16 @@
17181718
** n=COUNT Maximum number of events. "all" for no limit
17191719
** n1=COUNT Same as "n" but doesn't set the display-preference cookie
17201720
** Use "n1=COUNT" for a one-time display change
17211721
** p=CHECKIN Parents and ancestors of CHECKIN
17221722
** bt=PRIOR ... going back to PRIOR
1723
+** p2=CKIN2 ... use CKIN2 if CHECKIN is not found
17231724
** d=CHECKIN Children and descendants of CHECKIN
1725
+** d2=CKIN2 ... Use CKIN2 if CHECKIN is not found
17241726
** ft=DESCENDANT ... going forward to DESCENDANT
17251727
** dp=CHECKIN Same as 'd=CHECKIN&p=CHECKIN'
1728
+** dp2=CKIN2 Same as 'd2=CKIN2&p2=CKIN2'
17261729
** df=CHECKIN Same as 'd=CHECKIN&n1=all&nd'. Mnemonic: "Derived From"
17271730
** bt=CHECKIN "Back To". Show ancenstors going back to CHECKIN
17281731
** p=CX ... from CX back to time of CHECKIN
17291732
** from=CX ... shortest path from CX back to CHECKIN
17301733
** ft=CHECKIN "Forward To": Show decendents forward to CHECKIN
@@ -1844,10 +1847,11 @@
18441847
int to_rid = name_choice("to","to2",&zTo2); /* to= for path timelines */
18451848
int noMerge = P("shortest")==0; /* Follow merge links if shorter */
18461849
int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
18471850
int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
18481851
int pd_rid;
1852
+ const char *zDPName; /* Value of p=, d=, or dp= params */
18491853
double rBefore, rAfter, rCirca; /* Boundary times */
18501854
const char *z;
18511855
char *zOlderButton = 0; /* URL for Older button at the bottom */
18521856
char *zOlderButtonLabel = 0; /* Label for the Older Button */
18531857
char *zNewerButton = 0; /* URL for Newer button at the top */
@@ -1902,14 +1906,12 @@
19021906
}else{
19031907
nEntry = 50;
19041908
}
19051909
19061910
/* Query parameters d=, p=, and f= and variants */
1907
- z = P("p");
1908
- p_rid = z ? name_to_typed_rid(z,"ci") : 0;
1909
- z = P("d");
1910
- d_rid = z ? name_to_typed_rid(z,"ci") : 0;
1911
+ p_rid = name_choice("p","p2", &zDPName);
1912
+ d_rid = name_choice("d","d2", &zDPName);
19111913
z = P("f");
19121914
f_rid = z ? name_to_typed_rid(z,"ci") : 0;
19131915
z = P("df");
19141916
if( z && (d_rid = name_to_typed_rid(z,"ci"))!=0 ){
19151917
nEntry = 0;
@@ -1936,11 +1938,11 @@
19361938
showCherrypicks = 0;
19371939
}
19381940
19391941
/* To view the timeline, must have permission to read project data.
19401942
*/
1941
- pd_rid = name_to_typed_rid(P("dp"),"ci");
1943
+ pd_rid = name_choice("dp","dp2",&zDPName);
19421944
if( pd_rid ){
19431945
p_rid = d_rid = pd_rid;
19441946
}
19451947
login_check_credentials();
19461948
if( (!g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki && !g.perm.RdForum)
@@ -2329,11 +2331,11 @@
23292331
db_multi_exec(
23302332
"CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY)"
23312333
);
23322334
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d",
23332335
p_rid ? p_rid : d_rid);
2334
- zCiName = pd_rid ? P("pd") : p_rid ? P("p") : P("d");
2336
+ zCiName = zDPName;
23352337
if( zCiName==0 ) zCiName = zUuid;
23362338
blob_append_sql(&sql, " AND event.objid IN ok");
23372339
nd = 0;
23382340
if( d_rid ){
23392341
Stmt s;
23402342
--- src/timeline.c
+++ src/timeline.c
@@ -1718,13 +1718,16 @@
1718 ** n=COUNT Maximum number of events. "all" for no limit
1719 ** n1=COUNT Same as "n" but doesn't set the display-preference cookie
1720 ** Use "n1=COUNT" for a one-time display change
1721 ** p=CHECKIN Parents and ancestors of CHECKIN
1722 ** bt=PRIOR ... going back to PRIOR
 
1723 ** d=CHECKIN Children and descendants of CHECKIN
 
1724 ** ft=DESCENDANT ... going forward to DESCENDANT
1725 ** dp=CHECKIN Same as 'd=CHECKIN&p=CHECKIN'
 
1726 ** df=CHECKIN Same as 'd=CHECKIN&n1=all&nd'. Mnemonic: "Derived From"
1727 ** bt=CHECKIN "Back To". Show ancenstors going back to CHECKIN
1728 ** p=CX ... from CX back to time of CHECKIN
1729 ** from=CX ... shortest path from CX back to CHECKIN
1730 ** ft=CHECKIN "Forward To": Show decendents forward to CHECKIN
@@ -1844,10 +1847,11 @@
1844 int to_rid = name_choice("to","to2",&zTo2); /* to= for path timelines */
1845 int noMerge = P("shortest")==0; /* Follow merge links if shorter */
1846 int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
1847 int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
1848 int pd_rid;
 
1849 double rBefore, rAfter, rCirca; /* Boundary times */
1850 const char *z;
1851 char *zOlderButton = 0; /* URL for Older button at the bottom */
1852 char *zOlderButtonLabel = 0; /* Label for the Older Button */
1853 char *zNewerButton = 0; /* URL for Newer button at the top */
@@ -1902,14 +1906,12 @@
1902 }else{
1903 nEntry = 50;
1904 }
1905
1906 /* Query parameters d=, p=, and f= and variants */
1907 z = P("p");
1908 p_rid = z ? name_to_typed_rid(z,"ci") : 0;
1909 z = P("d");
1910 d_rid = z ? name_to_typed_rid(z,"ci") : 0;
1911 z = P("f");
1912 f_rid = z ? name_to_typed_rid(z,"ci") : 0;
1913 z = P("df");
1914 if( z && (d_rid = name_to_typed_rid(z,"ci"))!=0 ){
1915 nEntry = 0;
@@ -1936,11 +1938,11 @@
1936 showCherrypicks = 0;
1937 }
1938
1939 /* To view the timeline, must have permission to read project data.
1940 */
1941 pd_rid = name_to_typed_rid(P("dp"),"ci");
1942 if( pd_rid ){
1943 p_rid = d_rid = pd_rid;
1944 }
1945 login_check_credentials();
1946 if( (!g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki && !g.perm.RdForum)
@@ -2329,11 +2331,11 @@
2329 db_multi_exec(
2330 "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY)"
2331 );
2332 zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d",
2333 p_rid ? p_rid : d_rid);
2334 zCiName = pd_rid ? P("pd") : p_rid ? P("p") : P("d");
2335 if( zCiName==0 ) zCiName = zUuid;
2336 blob_append_sql(&sql, " AND event.objid IN ok");
2337 nd = 0;
2338 if( d_rid ){
2339 Stmt s;
2340
--- src/timeline.c
+++ src/timeline.c
@@ -1718,13 +1718,16 @@
1718 ** n=COUNT Maximum number of events. "all" for no limit
1719 ** n1=COUNT Same as "n" but doesn't set the display-preference cookie
1720 ** Use "n1=COUNT" for a one-time display change
1721 ** p=CHECKIN Parents and ancestors of CHECKIN
1722 ** bt=PRIOR ... going back to PRIOR
1723 ** p2=CKIN2 ... use CKIN2 if CHECKIN is not found
1724 ** d=CHECKIN Children and descendants of CHECKIN
1725 ** d2=CKIN2 ... Use CKIN2 if CHECKIN is not found
1726 ** ft=DESCENDANT ... going forward to DESCENDANT
1727 ** dp=CHECKIN Same as 'd=CHECKIN&p=CHECKIN'
1728 ** dp2=CKIN2 Same as 'd2=CKIN2&p2=CKIN2'
1729 ** df=CHECKIN Same as 'd=CHECKIN&n1=all&nd'. Mnemonic: "Derived From"
1730 ** bt=CHECKIN "Back To". Show ancenstors going back to CHECKIN
1731 ** p=CX ... from CX back to time of CHECKIN
1732 ** from=CX ... shortest path from CX back to CHECKIN
1733 ** ft=CHECKIN "Forward To": Show decendents forward to CHECKIN
@@ -1844,10 +1847,11 @@
1847 int to_rid = name_choice("to","to2",&zTo2); /* to= for path timelines */
1848 int noMerge = P("shortest")==0; /* Follow merge links if shorter */
1849 int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
1850 int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
1851 int pd_rid;
1852 const char *zDPName; /* Value of p=, d=, or dp= params */
1853 double rBefore, rAfter, rCirca; /* Boundary times */
1854 const char *z;
1855 char *zOlderButton = 0; /* URL for Older button at the bottom */
1856 char *zOlderButtonLabel = 0; /* Label for the Older Button */
1857 char *zNewerButton = 0; /* URL for Newer button at the top */
@@ -1902,14 +1906,12 @@
1906 }else{
1907 nEntry = 50;
1908 }
1909
1910 /* Query parameters d=, p=, and f= and variants */
1911 p_rid = name_choice("p","p2", &zDPName);
1912 d_rid = name_choice("d","d2", &zDPName);
 
 
1913 z = P("f");
1914 f_rid = z ? name_to_typed_rid(z,"ci") : 0;
1915 z = P("df");
1916 if( z && (d_rid = name_to_typed_rid(z,"ci"))!=0 ){
1917 nEntry = 0;
@@ -1936,11 +1938,11 @@
1938 showCherrypicks = 0;
1939 }
1940
1941 /* To view the timeline, must have permission to read project data.
1942 */
1943 pd_rid = name_choice("dp","dp2",&zDPName);
1944 if( pd_rid ){
1945 p_rid = d_rid = pd_rid;
1946 }
1947 login_check_credentials();
1948 if( (!g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki && !g.perm.RdForum)
@@ -2329,11 +2331,11 @@
2331 db_multi_exec(
2332 "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY)"
2333 );
2334 zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d",
2335 p_rid ? p_rid : d_rid);
2336 zCiName = zDPName;
2337 if( zCiName==0 ) zCiName = zUuid;
2338 blob_append_sql(&sql, " AND event.objid IN ok");
2339 nd = 0;
2340 if( d_rid ){
2341 Stmt s;
2342

Keyboard Shortcuts

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