Fossil SCM
In the timeline, remove the "shortest" flag on the from=,to= configuration, as it is not useful. Simplify the implementation of the "min" flag.
Commit
e09d965fe0d586242773d95368ceb1df5d1a961e74c0e47d55d5d899b09533aa
Parent
923dca30146d863…
1 file changed
+8
-22
+8
-22
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1603,11 +1603,10 @@ | ||
| 1603 | 1603 | ** vfx Show complete text of forum messages |
| 1604 | 1604 | ** f=CHECKIN Family (immediate parents and children) of CHECKIN |
| 1605 | 1605 | ** from=CHECKIN Path through common ancestor from... |
| 1606 | 1606 | ** to=CHECKIN ... to this |
| 1607 | 1607 | ** to2=CHECKIN ... backup name if to= doesn't resolve |
| 1608 | -** shortest ... show only the shortest path | |
| 1609 | 1608 | ** rel ... also show related checkins |
| 1610 | 1609 | ** min ... only show key nodes of the path |
| 1611 | 1610 | ** abd ... avoid branch detours |
| 1612 | 1611 | ** bt=PRIOR ... path from CHECKIN back to PRIOR |
| 1613 | 1612 | ** ft=LATER ... path from CHECKIN forward to LATER |
| @@ -1698,11 +1697,10 @@ | ||
| 1698 | 1697 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 1699 | 1698 | HQuery url; /* URL for various branch links */ |
| 1700 | 1699 | int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */ |
| 1701 | 1700 | const char *zTo2 = 0; |
| 1702 | 1701 | int to_rid = name_choice("to","to2",&zTo2); /* to= for path timelines */ |
| 1703 | - int noMerge = P("shortest")==0; /* Follow merge links if shorter */ | |
| 1704 | 1702 | int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */ |
| 1705 | 1703 | int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */ |
| 1706 | 1704 | int pd_rid; |
| 1707 | 1705 | const char *zDPName; /* Value of p=, d=, or dp= params */ |
| 1708 | 1706 | double rBefore, rAfter, rCirca; /* Boundary times */ |
| @@ -2075,15 +2073,15 @@ | ||
| 2075 | 2073 | const char *zTo = 0; |
| 2076 | 2074 | Blob ins; |
| 2077 | 2075 | int nNodeOnPath = 0; |
| 2078 | 2076 | int commonAncs = 0; /* Common ancestors of me_rid and you_rid. */ |
| 2079 | 2077 | int earlierRid = 0, laterRid = 0; |
| 2080 | - int cost = bMin || P("abd")!=0 ? 100 : 0; | |
| 2078 | + int cost = bMin || P("abd")!=0 ? 1 : 0; | |
| 2081 | 2079 | |
| 2082 | 2080 | if( from_rid && to_rid ){ |
| 2083 | 2081 | if( from_to_mode==0 ){ |
| 2084 | - p = path_shortest(from_rid, to_rid, noMerge, 0, 0, cost); | |
| 2082 | + p = path_shortest(from_rid, to_rid, 0, 0, 0, cost); | |
| 2085 | 2083 | }else if( from_to_mode==1 ){ |
| 2086 | 2084 | p = path_shortest(from_rid, to_rid, 0, 1, 0, cost); |
| 2087 | 2085 | earlierRid = commonAncs = from_rid; |
| 2088 | 2086 | laterRid = to_rid; |
| 2089 | 2087 | }else{ |
| @@ -2114,41 +2112,29 @@ | ||
| 2114 | 2112 | db_multi_exec( |
| 2115 | 2113 | "CREATE TEMP TABLE IF NOT EXISTS pathnode(x INTEGER PRIMARY KEY);" |
| 2116 | 2114 | ); |
| 2117 | 2115 | if( p ){ |
| 2118 | 2116 | int cnt = 4; |
| 2119 | - char *zPriorBr = 0, *zThisBr = 0, *zNextBr = 0; | |
| 2120 | 2117 | blob_init(&ins, 0, 0); |
| 2121 | 2118 | blob_append_sql(&ins, "INSERT INTO pathnode(x) VALUES(%d)", p->rid); |
| 2122 | 2119 | if( p->u.pTo==0 ) bMin = 0; |
| 2123 | - if( bMin ){ | |
| 2124 | - zThisBr = branch_of_rid(p->rid); | |
| 2125 | - zNextBr = branch_of_rid(p->u.pTo->rid); | |
| 2126 | - } | |
| 2127 | 2120 | for(p=p->u.pTo; p; p=p->u.pTo){ |
| 2128 | - if( bMin && p->u.pTo!=0 ){ | |
| 2129 | - fossil_free(zPriorBr); | |
| 2130 | - zPriorBr = zThisBr; | |
| 2131 | - zThisBr = zNextBr; | |
| 2132 | - zNextBr = branch_of_rid(p->u.pTo->rid); | |
| 2133 | - if( fossil_strcmp(zPriorBr,zThisBr)==0 | |
| 2134 | - && fossil_strcmp(zThisBr,zNextBr)==0 | |
| 2135 | - ){ | |
| 2136 | - continue; | |
| 2137 | - } | |
| 2121 | + if( bMin | |
| 2122 | + && p->u.pTo!=0 | |
| 2123 | + && fossil_strcmp(p->pFrom->zBranch,p->zBranch)==0 | |
| 2124 | + && fossil_strcmp(p->zBranch,p->u.pTo->zBranch)==0 | |
| 2125 | + ){ | |
| 2126 | + continue; | |
| 2138 | 2127 | } |
| 2139 | 2128 | if( cnt==8 ){ |
| 2140 | 2129 | blob_append_sql(&ins, ",\n (%d)", p->rid); |
| 2141 | 2130 | cnt = 0; |
| 2142 | 2131 | }else{ |
| 2143 | 2132 | cnt++; |
| 2144 | 2133 | blob_append_sql(&ins, ",(%d)", p->rid); |
| 2145 | 2134 | } |
| 2146 | 2135 | } |
| 2147 | - fossil_free(zPriorBr); | |
| 2148 | - fossil_free(zThisBr); | |
| 2149 | - fossil_free(zNextBr); | |
| 2150 | 2136 | } |
| 2151 | 2137 | path_reset(); |
| 2152 | 2138 | db_multi_exec("%s", blob_str(&ins)/*safe-for-%s*/); |
| 2153 | 2139 | blob_reset(&ins); |
| 2154 | 2140 | if( related ){ |
| 2155 | 2141 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1603,11 +1603,10 @@ | |
| 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 | ** shortest ... show only the shortest path |
| 1609 | ** rel ... also show related checkins |
| 1610 | ** min ... only show key nodes of the path |
| 1611 | ** abd ... avoid branch detours |
| 1612 | ** bt=PRIOR ... path from CHECKIN back to PRIOR |
| 1613 | ** ft=LATER ... path from CHECKIN forward to LATER |
| @@ -1698,11 +1697,10 @@ | |
| 1698 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 1699 | HQuery url; /* URL for various branch links */ |
| 1700 | int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */ |
| 1701 | const char *zTo2 = 0; |
| 1702 | int to_rid = name_choice("to","to2",&zTo2); /* to= for path timelines */ |
| 1703 | int noMerge = P("shortest")==0; /* Follow merge links if shorter */ |
| 1704 | int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */ |
| 1705 | int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */ |
| 1706 | int pd_rid; |
| 1707 | const char *zDPName; /* Value of p=, d=, or dp= params */ |
| 1708 | double rBefore, rAfter, rCirca; /* Boundary times */ |
| @@ -2075,15 +2073,15 @@ | |
| 2075 | const char *zTo = 0; |
| 2076 | Blob ins; |
| 2077 | int nNodeOnPath = 0; |
| 2078 | int commonAncs = 0; /* Common ancestors of me_rid and you_rid. */ |
| 2079 | int earlierRid = 0, laterRid = 0; |
| 2080 | int cost = bMin || P("abd")!=0 ? 100 : 0; |
| 2081 | |
| 2082 | if( from_rid && to_rid ){ |
| 2083 | if( from_to_mode==0 ){ |
| 2084 | p = path_shortest(from_rid, to_rid, noMerge, 0, 0, cost); |
| 2085 | }else if( from_to_mode==1 ){ |
| 2086 | p = path_shortest(from_rid, to_rid, 0, 1, 0, cost); |
| 2087 | earlierRid = commonAncs = from_rid; |
| 2088 | laterRid = to_rid; |
| 2089 | }else{ |
| @@ -2114,41 +2112,29 @@ | |
| 2114 | db_multi_exec( |
| 2115 | "CREATE TEMP TABLE IF NOT EXISTS pathnode(x INTEGER PRIMARY KEY);" |
| 2116 | ); |
| 2117 | if( p ){ |
| 2118 | int cnt = 4; |
| 2119 | char *zPriorBr = 0, *zThisBr = 0, *zNextBr = 0; |
| 2120 | blob_init(&ins, 0, 0); |
| 2121 | blob_append_sql(&ins, "INSERT INTO pathnode(x) VALUES(%d)", p->rid); |
| 2122 | if( p->u.pTo==0 ) bMin = 0; |
| 2123 | if( bMin ){ |
| 2124 | zThisBr = branch_of_rid(p->rid); |
| 2125 | zNextBr = branch_of_rid(p->u.pTo->rid); |
| 2126 | } |
| 2127 | for(p=p->u.pTo; p; p=p->u.pTo){ |
| 2128 | if( bMin && p->u.pTo!=0 ){ |
| 2129 | fossil_free(zPriorBr); |
| 2130 | zPriorBr = zThisBr; |
| 2131 | zThisBr = zNextBr; |
| 2132 | zNextBr = branch_of_rid(p->u.pTo->rid); |
| 2133 | if( fossil_strcmp(zPriorBr,zThisBr)==0 |
| 2134 | && fossil_strcmp(zThisBr,zNextBr)==0 |
| 2135 | ){ |
| 2136 | continue; |
| 2137 | } |
| 2138 | } |
| 2139 | if( cnt==8 ){ |
| 2140 | blob_append_sql(&ins, ",\n (%d)", p->rid); |
| 2141 | cnt = 0; |
| 2142 | }else{ |
| 2143 | cnt++; |
| 2144 | blob_append_sql(&ins, ",(%d)", p->rid); |
| 2145 | } |
| 2146 | } |
| 2147 | fossil_free(zPriorBr); |
| 2148 | fossil_free(zThisBr); |
| 2149 | fossil_free(zNextBr); |
| 2150 | } |
| 2151 | path_reset(); |
| 2152 | db_multi_exec("%s", blob_str(&ins)/*safe-for-%s*/); |
| 2153 | blob_reset(&ins); |
| 2154 | if( related ){ |
| 2155 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1603,11 +1603,10 @@ | |
| 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 |
| @@ -1698,11 +1697,10 @@ | |
| 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 */ |
| @@ -2075,15 +2073,15 @@ | |
| 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 | p = path_shortest(from_rid, to_rid, 0, 1, 0, cost); |
| 2085 | earlierRid = commonAncs = from_rid; |
| 2086 | laterRid = to_rid; |
| 2087 | }else{ |
| @@ -2114,41 +2112,29 @@ | |
| 2112 | db_multi_exec( |
| 2113 | "CREATE TEMP TABLE IF NOT EXISTS pathnode(x INTEGER PRIMARY KEY);" |
| 2114 | ); |
| 2115 | if( p ){ |
| 2116 | int cnt = 4; |
| 2117 | blob_init(&ins, 0, 0); |
| 2118 | blob_append_sql(&ins, "INSERT INTO pathnode(x) VALUES(%d)", p->rid); |
| 2119 | if( p->u.pTo==0 ) bMin = 0; |
| 2120 | for(p=p->u.pTo; p; p=p->u.pTo){ |
| 2121 | if( bMin |
| 2122 | && p->u.pTo!=0 |
| 2123 | && fossil_strcmp(p->pFrom->zBranch,p->zBranch)==0 |
| 2124 | && fossil_strcmp(p->zBranch,p->u.pTo->zBranch)==0 |
| 2125 | ){ |
| 2126 | continue; |
| 2127 | } |
| 2128 | if( cnt==8 ){ |
| 2129 | blob_append_sql(&ins, ",\n (%d)", p->rid); |
| 2130 | cnt = 0; |
| 2131 | }else{ |
| 2132 | cnt++; |
| 2133 | blob_append_sql(&ins, ",(%d)", p->rid); |
| 2134 | } |
| 2135 | } |
| 2136 | } |
| 2137 | path_reset(); |
| 2138 | db_multi_exec("%s", blob_str(&ins)/*safe-for-%s*/); |
| 2139 | blob_reset(&ins); |
| 2140 | if( related ){ |
| 2141 |