Fossil SCM

Add the to2=LABEL query parameter to timeline. This is intended as a backup name for to=END in case the END label cannot be resolved.

drh 2024-03-09 19:17 trunk
Commit 1ff12ea630642d49339a17e01feb16a5b50572b326020a3c2f7c41447b6c815f
2 files changed +24 +2 -1
+24
--- src/name.c
+++ src/name.c
@@ -819,10 +819,34 @@
819819
return rid;
820820
}
821821
int name_to_rid(const char *zName){
822822
return name_to_typed_rid(zName, "*");
823823
}
824
+
825
+/*
826
+** Try to resolve zQP1 into a check-in name. If zQP1 does not exist,
827
+** return 0. If zQP1 exists but cannot be resolved, then also try to
828
+** resolve zQP2 if it exists. If zQP1 cannot be resolved but zQP2 does
829
+** not exist, then raise an error. If both zQP1 and zQP2 exists but
830
+** neither can be resolved, also raise an error.
831
+*/
832
+int name_choice(const char *zQP1, const char *zQP2){
833
+ const char *zName, *zName2;
834
+ int rid;
835
+ zName = P(zQP1);
836
+ if( zName==0 || zName[0]==0 ) return 0;
837
+ rid = symbolic_name_to_rid(zName, "ci");
838
+ if( rid>0 ) return rid;
839
+ if( rid<0 ){
840
+ fossil_fatal("ambiguous name: %s", zName);
841
+ }
842
+ zName2 = P(zQP2);
843
+ if( zName2==0 || zName2[0]==0 ){
844
+ fossil_fatal("cannot resolve name: %s", zName);
845
+ }
846
+ return name_to_typed_rid(zName2, "ci");
847
+}
824848
825849
/*
826850
** WEBPAGE: ambiguous
827851
** URL: /ambiguous?name=NAME&src=WEBPAGE
828852
**
829853
--- src/name.c
+++ src/name.c
@@ -819,10 +819,34 @@
819 return rid;
820 }
821 int name_to_rid(const char *zName){
822 return name_to_typed_rid(zName, "*");
823 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
824
825 /*
826 ** WEBPAGE: ambiguous
827 ** URL: /ambiguous?name=NAME&src=WEBPAGE
828 **
829
--- src/name.c
+++ src/name.c
@@ -819,10 +819,34 @@
819 return rid;
820 }
821 int name_to_rid(const char *zName){
822 return name_to_typed_rid(zName, "*");
823 }
824
825 /*
826 ** Try to resolve zQP1 into a check-in name. If zQP1 does not exist,
827 ** return 0. If zQP1 exists but cannot be resolved, then also try to
828 ** resolve zQP2 if it exists. If zQP1 cannot be resolved but zQP2 does
829 ** not exist, then raise an error. If both zQP1 and zQP2 exists but
830 ** neither can be resolved, also raise an error.
831 */
832 int name_choice(const char *zQP1, const char *zQP2){
833 const char *zName, *zName2;
834 int rid;
835 zName = P(zQP1);
836 if( zName==0 || zName[0]==0 ) return 0;
837 rid = symbolic_name_to_rid(zName, "ci");
838 if( rid>0 ) return rid;
839 if( rid<0 ){
840 fossil_fatal("ambiguous name: %s", zName);
841 }
842 zName2 = P(zQP2);
843 if( zName2==0 || zName2[0]==0 ){
844 fossil_fatal("cannot resolve name: %s", zName);
845 }
846 return name_to_typed_rid(zName2, "ci");
847 }
848
849 /*
850 ** WEBPAGE: ambiguous
851 ** URL: /ambiguous?name=NAME&src=WEBPAGE
852 **
853
+2 -1
--- src/timeline.c
+++ src/timeline.c
@@ -1751,10 +1751,11 @@
17511751
** v Show details of files changed
17521752
** vfx Show complete text of forum messages
17531753
** f=CHECKIN Show family (immediate parents and children) of CHECKIN
17541754
** from=CHECKIN Path from...
17551755
** to=CHECKIN ... to this
1756
+** to2=CHECKIN ... backup name if to= doesn't resolve
17561757
** shortest ... show only the shortest path
17571758
** rel ... also show related checkins
17581759
** bt=PRIOR ... path from CHECKIN back to PRIOR
17591760
** ft=LATER ... path from CHECKIN forward to LATER
17601761
** uf=FILE_HASH Show only check-ins that contain the given file version
@@ -1837,11 +1838,11 @@
18371838
int tmFlags = 0; /* Timeline flags */
18381839
const char *zThisTag = 0; /* Suppress links to this tag */
18391840
const char *zThisUser = 0; /* Suppress links to this user */
18401841
HQuery url; /* URL for various branch links */
18411842
int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */
1842
- int to_rid = name_to_typed_rid(P("to"),"ci"); /* to= for path timelines */
1843
+ int to_rid = name_choice("to","to2"); /* to= for path timelines */
18431844
int noMerge = P("shortest")==0; /* Follow merge links if shorter */
18441845
int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
18451846
int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
18461847
int pd_rid;
18471848
double rBefore, rAfter, rCirca; /* Boundary times */
18481849
--- src/timeline.c
+++ src/timeline.c
@@ -1751,10 +1751,11 @@
1751 ** v Show details of files changed
1752 ** vfx Show complete text of forum messages
1753 ** f=CHECKIN Show family (immediate parents and children) of CHECKIN
1754 ** from=CHECKIN Path from...
1755 ** to=CHECKIN ... to this
 
1756 ** shortest ... show only the shortest path
1757 ** rel ... also show related checkins
1758 ** bt=PRIOR ... path from CHECKIN back to PRIOR
1759 ** ft=LATER ... path from CHECKIN forward to LATER
1760 ** uf=FILE_HASH Show only check-ins that contain the given file version
@@ -1837,11 +1838,11 @@
1837 int tmFlags = 0; /* Timeline flags */
1838 const char *zThisTag = 0; /* Suppress links to this tag */
1839 const char *zThisUser = 0; /* Suppress links to this user */
1840 HQuery url; /* URL for various branch links */
1841 int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */
1842 int to_rid = name_to_typed_rid(P("to"),"ci"); /* to= for path timelines */
1843 int noMerge = P("shortest")==0; /* Follow merge links if shorter */
1844 int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
1845 int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
1846 int pd_rid;
1847 double rBefore, rAfter, rCirca; /* Boundary times */
1848
--- src/timeline.c
+++ src/timeline.c
@@ -1751,10 +1751,11 @@
1751 ** v Show details of files changed
1752 ** vfx Show complete text of forum messages
1753 ** f=CHECKIN Show family (immediate parents and children) of CHECKIN
1754 ** from=CHECKIN Path from...
1755 ** to=CHECKIN ... to this
1756 ** to2=CHECKIN ... backup name if to= doesn't resolve
1757 ** shortest ... show only the shortest path
1758 ** rel ... also show related checkins
1759 ** bt=PRIOR ... path from CHECKIN back to PRIOR
1760 ** ft=LATER ... path from CHECKIN forward to LATER
1761 ** uf=FILE_HASH Show only check-ins that contain the given file version
@@ -1837,11 +1838,11 @@
1838 int tmFlags = 0; /* Timeline flags */
1839 const char *zThisTag = 0; /* Suppress links to this tag */
1840 const char *zThisUser = 0; /* Suppress links to this user */
1841 HQuery url; /* URL for various branch links */
1842 int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */
1843 int to_rid = name_choice("to","to2"); /* to= for path timelines */
1844 int noMerge = P("shortest")==0; /* Follow merge links if shorter */
1845 int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
1846 int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
1847 int pd_rid;
1848 double rBefore, rAfter, rCirca; /* Boundary times */
1849

Keyboard Shortcuts

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