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.
Commit
1ff12ea630642d49339a17e01feb16a5b50572b326020a3c2f7c41447b6c815f
Parent
3b99d2ca2634dd5…
2 files changed
+24
+2
-1
+24
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -819,10 +819,34 @@ | ||
| 819 | 819 | return rid; |
| 820 | 820 | } |
| 821 | 821 | int name_to_rid(const char *zName){ |
| 822 | 822 | return name_to_typed_rid(zName, "*"); |
| 823 | 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 | +} | |
| 824 | 848 | |
| 825 | 849 | /* |
| 826 | 850 | ** WEBPAGE: ambiguous |
| 827 | 851 | ** URL: /ambiguous?name=NAME&src=WEBPAGE |
| 828 | 852 | ** |
| 829 | 853 |
| --- 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 @@ | ||
| 1751 | 1751 | ** v Show details of files changed |
| 1752 | 1752 | ** vfx Show complete text of forum messages |
| 1753 | 1753 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1754 | 1754 | ** from=CHECKIN Path from... |
| 1755 | 1755 | ** to=CHECKIN ... to this |
| 1756 | +** to2=CHECKIN ... backup name if to= doesn't resolve | |
| 1756 | 1757 | ** shortest ... show only the shortest path |
| 1757 | 1758 | ** rel ... also show related checkins |
| 1758 | 1759 | ** bt=PRIOR ... path from CHECKIN back to PRIOR |
| 1759 | 1760 | ** ft=LATER ... path from CHECKIN forward to LATER |
| 1760 | 1761 | ** uf=FILE_HASH Show only check-ins that contain the given file version |
| @@ -1837,11 +1838,11 @@ | ||
| 1837 | 1838 | int tmFlags = 0; /* Timeline flags */ |
| 1838 | 1839 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| 1839 | 1840 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 1840 | 1841 | HQuery url; /* URL for various branch links */ |
| 1841 | 1842 | 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 */ | |
| 1843 | 1844 | int noMerge = P("shortest")==0; /* Follow merge links if shorter */ |
| 1844 | 1845 | int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */ |
| 1845 | 1846 | int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */ |
| 1846 | 1847 | int pd_rid; |
| 1847 | 1848 | double rBefore, rAfter, rCirca; /* Boundary times */ |
| 1848 | 1849 |
| --- 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 |