Fossil SCM

Restore the "shortest" query parameter on /timeline. Make it actually show the path with the fewest number of nodes, as it was originally intended. Improve the /help for /timeline.

drh 2025-03-08 23:58 min-from-to
Commit a91586d2563e5ff579a6c08d1e8df35cbd7bad82a10cf3e44f970b102674e083
1 file changed +15 -14
+15 -14
--- src/timeline.c
+++ src/timeline.c
@@ -1572,14 +1572,14 @@
15721572
** dp=CHECKIN Same as 'd=CHECKIN&p=CHECKIN'
15731573
** dp2=CKIN2 Same as 'd2=CKIN2&p2=CKIN2'
15741574
** df=CHECKIN Same as 'd=CHECKIN&n1=all&nd'. Mnemonic: "Derived From"
15751575
** bt=CHECKIN "Back To". Show ancenstors going back to CHECKIN
15761576
** p=CX ... from CX back to time of CHECKIN
1577
-** from=CX ... shortest path from CX back to CHECKIN
1577
+** from=CX ... path from CX back to CHECKIN
15781578
** ft=CHECKIN "Forward To": Show decendents forward to CHECKIN
15791579
** d=CX ... from CX up to the time of CHECKIN
1580
-** from=CX ... shortest path from CX up to CHECKIN
1580
+** from=CX ... path from CX up to CHECKIN
15811581
** t=TAG Show only check-ins with the given TAG
15821582
** r=TAG Same as 't=TAG&rel'. Mnemonic: "Related"
15831583
** tl=TAGLIST Same as 't=TAGLIST&ms=brlist'. Mnemonic: "Tag List"
15841584
** rl=TAGLIST Same as 'r=TAGLIST&ms=brlist'. Mnemonic: "Related List"
15851585
** ml=TAGLIST Same as 'tl=TAGLIST&mionly'. Mnemonic: "Merge-in List"
@@ -1600,21 +1600,21 @@
16001600
** nsm Omit the submenu
16011601
** nc Omit all graph colors other than highlights
16021602
** v Show details of files changed
16031603
** vfx Show complete text of forum messages
16041604
** f=CHECKIN Family (immediate parents and children) of CHECKIN
1605
-** from=CHECKIN Path through common ancestor from...
1606
-** to=CHECKIN ... to this
1607
-** to2=CHECKIN ... backup name if to= doesn't resolve
1608
-** rel ... also show related checkins
1609
-** min ... only show key nodes of the path
1610
-** abd ... avoid branch detours
1611
-** bt=PRIOR ... path from CHECKIN back to PRIOR
1612
-** ft=LATER ... path from CHECKIN forward to LATER
1613
-** me=CHECKIN Most direct path from...
1614
-** you=CHECKIN ... to this
1615
-** rel ... also show related checkins
1605
+** from=CHECKIN Path through common ancestor from CHECKIN...
1606
+** to=CHECKIN ... to this
1607
+** to2=CHECKIN ... backup name if to= doesn't resolve
1608
+** shortest ... pick path with least number of nodes
1609
+** rel ... also show related checkins
1610
+** min ... hide long sequences along same branch
1611
+** bt=PRIOR ... path from CHECKIN back to PRIOR
1612
+** ft=LATER ... path from CHECKIN forward to LATER
1613
+** me=CHECKIN Most direct path from CHECKIN...
1614
+** you=CHECKIN ... to this
1615
+** rel ... also show related checkins
16161616
** uf=FILE_HASH Show only check-ins that contain the given file version
16171617
** All qualifying check-ins are shown unless there is
16181618
** also an n= or n1= query parameter.
16191619
** chng=GLOBLIST Show only check-ins that involve changes to a file whose
16201620
** name matches one of the comma-separate GLOBLIST
@@ -1697,10 +1697,11 @@
16971697
const char *zThisUser = 0; /* Suppress links to this user */
16981698
HQuery url; /* URL for various branch links */
16991699
int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */
17001700
const char *zTo2 = 0;
17011701
int to_rid = name_choice("to","to2",&zTo2); /* to= for path timelines */
1702
+ int bShort = P("shortest")!=0; /* shortest possible path */
17021703
int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
17031704
int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
17041705
int pd_rid;
17051706
const char *zDPName; /* Value of p=, d=, or dp= params */
17061707
double rBefore, rAfter, rCirca; /* Boundary times */
@@ -2073,11 +2074,11 @@
20732074
const char *zTo = 0;
20742075
Blob ins;
20752076
int nNodeOnPath = 0;
20762077
int commonAncs = 0; /* Common ancestors of me_rid and you_rid. */
20772078
int earlierRid = 0, laterRid = 0;
2078
- int cost = bMin || P("abd")!=0 ? 1 : 0;
2079
+ int cost = bMin || !bShort ? 1 : 0;
20792080
20802081
if( from_rid && to_rid ){
20812082
if( from_to_mode==0 ){
20822083
p = path_shortest(from_rid, to_rid, 0, 0, 0, cost);
20832084
}else if( from_to_mode==1 ){
20842085
--- src/timeline.c
+++ src/timeline.c
@@ -1572,14 +1572,14 @@
1572 ** dp=CHECKIN Same as 'd=CHECKIN&p=CHECKIN'
1573 ** dp2=CKIN2 Same as 'd2=CKIN2&p2=CKIN2'
1574 ** df=CHECKIN Same as 'd=CHECKIN&n1=all&nd'. Mnemonic: "Derived From"
1575 ** bt=CHECKIN "Back To". Show ancenstors going back to CHECKIN
1576 ** p=CX ... from CX back to time of CHECKIN
1577 ** from=CX ... shortest path from CX back to CHECKIN
1578 ** ft=CHECKIN "Forward To": Show decendents forward to CHECKIN
1579 ** d=CX ... from CX up to the time of CHECKIN
1580 ** from=CX ... shortest path from CX up to CHECKIN
1581 ** t=TAG Show only check-ins with the given TAG
1582 ** r=TAG Same as 't=TAG&rel'. Mnemonic: "Related"
1583 ** tl=TAGLIST Same as 't=TAGLIST&ms=brlist'. Mnemonic: "Tag List"
1584 ** rl=TAGLIST Same as 'r=TAGLIST&ms=brlist'. Mnemonic: "Related List"
1585 ** ml=TAGLIST Same as 'tl=TAGLIST&mionly'. Mnemonic: "Merge-in List"
@@ -1600,21 +1600,21 @@
1600 ** nsm Omit the submenu
1601 ** nc Omit all graph colors other than highlights
1602 ** v Show details of files changed
1603 ** vfx Show complete text of forum messages
1604 ** f=CHECKIN Family (immediate parents and children) of CHECKIN
1605 ** from=CHECKIN Path through common ancestor from...
1606 ** to=CHECKIN ... to this
1607 ** to2=CHECKIN ... backup name if to= doesn't resolve
1608 ** rel ... also show related checkins
1609 ** min ... only show key nodes of the path
1610 ** abd ... avoid branch detours
1611 ** bt=PRIOR ... path from CHECKIN back to PRIOR
1612 ** ft=LATER ... path from CHECKIN forward to LATER
1613 ** me=CHECKIN Most direct path from...
1614 ** you=CHECKIN ... to this
1615 ** rel ... also show related checkins
1616 ** uf=FILE_HASH Show only check-ins that contain the given file version
1617 ** All qualifying check-ins are shown unless there is
1618 ** also an n= or n1= query parameter.
1619 ** chng=GLOBLIST Show only check-ins that involve changes to a file whose
1620 ** name matches one of the comma-separate GLOBLIST
@@ -1697,10 +1697,11 @@
1697 const char *zThisUser = 0; /* Suppress links to this user */
1698 HQuery url; /* URL for various branch links */
1699 int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */
1700 const char *zTo2 = 0;
1701 int to_rid = name_choice("to","to2",&zTo2); /* to= for path timelines */
 
1702 int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
1703 int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
1704 int pd_rid;
1705 const char *zDPName; /* Value of p=, d=, or dp= params */
1706 double rBefore, rAfter, rCirca; /* Boundary times */
@@ -2073,11 +2074,11 @@
2073 const char *zTo = 0;
2074 Blob ins;
2075 int nNodeOnPath = 0;
2076 int commonAncs = 0; /* Common ancestors of me_rid and you_rid. */
2077 int earlierRid = 0, laterRid = 0;
2078 int cost = bMin || P("abd")!=0 ? 1 : 0;
2079
2080 if( from_rid && to_rid ){
2081 if( from_to_mode==0 ){
2082 p = path_shortest(from_rid, to_rid, 0, 0, 0, cost);
2083 }else if( from_to_mode==1 ){
2084
--- src/timeline.c
+++ src/timeline.c
@@ -1572,14 +1572,14 @@
1572 ** dp=CHECKIN Same as 'd=CHECKIN&p=CHECKIN'
1573 ** dp2=CKIN2 Same as 'd2=CKIN2&p2=CKIN2'
1574 ** df=CHECKIN Same as 'd=CHECKIN&n1=all&nd'. Mnemonic: "Derived From"
1575 ** bt=CHECKIN "Back To". Show ancenstors going back to CHECKIN
1576 ** p=CX ... from CX back to time of CHECKIN
1577 ** from=CX ... path from CX back to CHECKIN
1578 ** ft=CHECKIN "Forward To": Show decendents forward to CHECKIN
1579 ** d=CX ... from CX up to the time of CHECKIN
1580 ** from=CX ... path from CX up to CHECKIN
1581 ** t=TAG Show only check-ins with the given TAG
1582 ** r=TAG Same as 't=TAG&rel'. Mnemonic: "Related"
1583 ** tl=TAGLIST Same as 't=TAGLIST&ms=brlist'. Mnemonic: "Tag List"
1584 ** rl=TAGLIST Same as 'r=TAGLIST&ms=brlist'. Mnemonic: "Related List"
1585 ** ml=TAGLIST Same as 'tl=TAGLIST&mionly'. Mnemonic: "Merge-in List"
@@ -1600,21 +1600,21 @@
1600 ** nsm Omit the submenu
1601 ** nc Omit all graph colors other than highlights
1602 ** v Show details of files changed
1603 ** vfx Show complete text of forum messages
1604 ** f=CHECKIN Family (immediate parents and children) of CHECKIN
1605 ** from=CHECKIN Path through common ancestor from CHECKIN...
1606 ** to=CHECKIN ... to this
1607 ** to2=CHECKIN ... backup name if to= doesn't resolve
1608 ** shortest ... pick path with least number of nodes
1609 ** rel ... also show related checkins
1610 ** min ... hide long sequences along same branch
1611 ** bt=PRIOR ... path from CHECKIN back to PRIOR
1612 ** ft=LATER ... path from CHECKIN forward to LATER
1613 ** me=CHECKIN Most direct path from CHECKIN...
1614 ** you=CHECKIN ... to this
1615 ** rel ... also show related checkins
1616 ** uf=FILE_HASH Show only check-ins that contain the given file version
1617 ** All qualifying check-ins are shown unless there is
1618 ** also an n= or n1= query parameter.
1619 ** chng=GLOBLIST Show only check-ins that involve changes to a file whose
1620 ** name matches one of the comma-separate GLOBLIST
@@ -1697,10 +1697,11 @@
1697 const char *zThisUser = 0; /* Suppress links to this user */
1698 HQuery url; /* URL for various branch links */
1699 int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */
1700 const char *zTo2 = 0;
1701 int to_rid = name_choice("to","to2",&zTo2); /* to= for path timelines */
1702 int bShort = P("shortest")!=0; /* shortest possible path */
1703 int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
1704 int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
1705 int pd_rid;
1706 const char *zDPName; /* Value of p=, d=, or dp= params */
1707 double rBefore, rAfter, rCirca; /* Boundary times */
@@ -2073,11 +2074,11 @@
2074 const char *zTo = 0;
2075 Blob ins;
2076 int nNodeOnPath = 0;
2077 int commonAncs = 0; /* Common ancestors of me_rid and you_rid. */
2078 int earlierRid = 0, laterRid = 0;
2079 int cost = bMin || !bShort ? 1 : 0;
2080
2081 if( from_rid && to_rid ){
2082 if( from_to_mode==0 ){
2083 p = path_shortest(from_rid, to_rid, 0, 0, 0, cost);
2084 }else if( from_to_mode==1 ){
2085

Keyboard Shortcuts

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