Fossil SCM

Try to avoid detours onto feature branches when selecting the shortest patch for a /timeline query with from= and ft= and the "min" query flag.

drh 2025-03-07 21:27 min-from-to
Commit 6c35335fb1834208894f80fe4e052d0abf5d2c6ee16928f1f3ec800504415844
3 files changed +4 -4 +30 -5 +4 -3
+4 -4
--- src/bisect.c
+++ src/bisect.c
@@ -37,13 +37,13 @@
3737
void bisect_path(void){
3838
PathNode *p;
3939
bisect.bad = db_lget_int("bisect-bad", 0);
4040
bisect.good = db_lget_int("bisect-good", 0);
4141
if( bisect.good>0 && bisect.bad==0 ){
42
- path_shortest(bisect.good, bisect.good, 0, 0, 0);
42
+ path_shortest(bisect.good, bisect.good, 0, 0, 0, 0);
4343
}else if( bisect.bad>0 && bisect.good==0 ){
44
- path_shortest(bisect.bad, bisect.bad, 0, 0, 0);
44
+ path_shortest(bisect.bad, bisect.bad, 0, 0, 0, 0);
4545
}else if( bisect.bad==0 && bisect.good==0 ){
4646
fossil_fatal("neither \"good\" nor \"bad\" versions have been identified");
4747
}else{
4848
Bag skip;
4949
int bDirect = bisect_option("direct-only");
@@ -55,11 +55,11 @@
5555
if( blob_str(&id)[0]=='s' ){
5656
bag_insert(&skip, atoi(blob_str(&id)+1));
5757
}
5858
}
5959
blob_reset(&log);
60
- p = path_shortest(bisect.good, bisect.bad, bDirect, 0, &skip);
60
+ p = path_shortest(bisect.good, bisect.bad, bDirect, 0, &skip, 0);
6161
bag_clear(&skip);
6262
if( p==0 ){
6363
char *zBad = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.bad);
6464
char *zGood = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.good);
6565
fossil_fatal("no path from good ([%S]) to bad ([%S]) or back",
@@ -292,11 +292,11 @@
292292
if( iCurrent>0 ){
293293
bisect_log_append(&ins, ++cnt, "CURRENT", iCurrent);
294294
}
295295
if( bDetail && lastGood>0 && lastBad>0 ){
296296
PathNode *p;
297
- p = path_shortest(lastGood, lastBad, bisect_option("direct-only"),0, 0);
297
+ p = path_shortest(lastGood, lastBad, bisect_option("direct-only"),0, 0, 0);
298298
while( p ){
299299
bisect_log_append(&ins, ++cnt, 0, p->rid);
300300
p = p->u.pTo;
301301
}
302302
path_reset();
303303
--- src/bisect.c
+++ src/bisect.c
@@ -37,13 +37,13 @@
37 void bisect_path(void){
38 PathNode *p;
39 bisect.bad = db_lget_int("bisect-bad", 0);
40 bisect.good = db_lget_int("bisect-good", 0);
41 if( bisect.good>0 && bisect.bad==0 ){
42 path_shortest(bisect.good, bisect.good, 0, 0, 0);
43 }else if( bisect.bad>0 && bisect.good==0 ){
44 path_shortest(bisect.bad, bisect.bad, 0, 0, 0);
45 }else if( bisect.bad==0 && bisect.good==0 ){
46 fossil_fatal("neither \"good\" nor \"bad\" versions have been identified");
47 }else{
48 Bag skip;
49 int bDirect = bisect_option("direct-only");
@@ -55,11 +55,11 @@
55 if( blob_str(&id)[0]=='s' ){
56 bag_insert(&skip, atoi(blob_str(&id)+1));
57 }
58 }
59 blob_reset(&log);
60 p = path_shortest(bisect.good, bisect.bad, bDirect, 0, &skip);
61 bag_clear(&skip);
62 if( p==0 ){
63 char *zBad = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.bad);
64 char *zGood = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.good);
65 fossil_fatal("no path from good ([%S]) to bad ([%S]) or back",
@@ -292,11 +292,11 @@
292 if( iCurrent>0 ){
293 bisect_log_append(&ins, ++cnt, "CURRENT", iCurrent);
294 }
295 if( bDetail && lastGood>0 && lastBad>0 ){
296 PathNode *p;
297 p = path_shortest(lastGood, lastBad, bisect_option("direct-only"),0, 0);
298 while( p ){
299 bisect_log_append(&ins, ++cnt, 0, p->rid);
300 p = p->u.pTo;
301 }
302 path_reset();
303
--- src/bisect.c
+++ src/bisect.c
@@ -37,13 +37,13 @@
37 void bisect_path(void){
38 PathNode *p;
39 bisect.bad = db_lget_int("bisect-bad", 0);
40 bisect.good = db_lget_int("bisect-good", 0);
41 if( bisect.good>0 && bisect.bad==0 ){
42 path_shortest(bisect.good, bisect.good, 0, 0, 0, 0);
43 }else if( bisect.bad>0 && bisect.good==0 ){
44 path_shortest(bisect.bad, bisect.bad, 0, 0, 0, 0);
45 }else if( bisect.bad==0 && bisect.good==0 ){
46 fossil_fatal("neither \"good\" nor \"bad\" versions have been identified");
47 }else{
48 Bag skip;
49 int bDirect = bisect_option("direct-only");
@@ -55,11 +55,11 @@
55 if( blob_str(&id)[0]=='s' ){
56 bag_insert(&skip, atoi(blob_str(&id)+1));
57 }
58 }
59 blob_reset(&log);
60 p = path_shortest(bisect.good, bisect.bad, bDirect, 0, &skip, 0);
61 bag_clear(&skip);
62 if( p==0 ){
63 char *zBad = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.bad);
64 char *zGood = db_text(0,"SELECT uuid FROM blob WHERE rid=%d",bisect.good);
65 fossil_fatal("no path from good ([%S]) to bad ([%S]) or back",
@@ -292,11 +292,11 @@
292 if( iCurrent>0 ){
293 bisect_log_append(&ins, ++cnt, "CURRENT", iCurrent);
294 }
295 if( bDetail && lastGood>0 && lastBad>0 ){
296 PathNode *p;
297 p = path_shortest(lastGood, lastBad, bisect_option("direct-only"),0, 0, 0);
298 while( p ){
299 bisect_log_append(&ins, ++cnt, 0, p->rid);
300 p = p->u.pTo;
301 }
302 path_reset();
303
+30 -5
--- src/path.c
+++ src/path.c
@@ -27,10 +27,12 @@
2727
struct PathNode {
2828
int rid; /* ID for this node */
2929
u8 fromIsParent; /* True if pFrom is the parent of rid */
3030
u8 isPrim; /* True if primary side of common ancestor */
3131
u8 isHidden; /* Abbreviate output in "fossil bisect ls" */
32
+ u8 nDelay; /* Delay this many steps before walking */
33
+ char *zBranch; /* Branch name for this node. Might be NULL */
3234
PathNode *pFrom; /* Node we came from */
3335
union {
3436
PathNode *pPeer; /* List of nodes of the same generation */
3537
PathNode *pTo; /* Next on path from beginning to end */
3638
} u;
@@ -45,10 +47,11 @@
4547
PathNode *pCurrent; /* Current generation of nodes */
4648
PathNode *pAll; /* All nodes */
4749
Bag seen; /* Nodes seen before */
4850
int nStep; /* Number of steps from first to last */
4951
int nNotHidden; /* Number of steps not counting hidden nodes */
52
+ u8 brCost; /* Extra cost for moving to a different branch */
5053
PathNode *pStart; /* Earliest node */
5154
PathNode *pEnd; /* Most recent */
5255
} path;
5356
5457
/*
@@ -76,10 +79,16 @@
7679
p = fossil_malloc( sizeof(*p) );
7780
memset(p, 0, sizeof(*p));
7881
p->rid = rid;
7982
p->fromIsParent = isParent;
8083
p->pFrom = pFrom;
84
+ if( path.brCost ){
85
+ p->zBranch = branch_of_rid(rid);
86
+ if( pFrom && fossil_strcmp(p->zBranch, pFrom->zBranch)!=0 ){
87
+ p->nDelay = path.brCost;
88
+ }
89
+ }
8190
p->u.pPeer = path.pCurrent;
8291
path.pCurrent = p;
8392
p->pAll = path.pAll;
8493
path.pAll = p;
8594
bag_insert(&path.seen, rid);
@@ -92,10 +101,11 @@
92101
void path_reset(void){
93102
PathNode *p;
94103
while( path.pAll ){
95104
p = path.pAll;
96105
path.pAll = p->pAll;
106
+ fossil_free(p->zBranch);
97107
fossil_free(p);
98108
}
99109
bag_clear(&path.seen);
100110
memset(&path, 0, sizeof(path));
101111
}
@@ -128,17 +138,20 @@
128138
PathNode *path_shortest(
129139
int iFrom, /* Path starts here */
130140
int iTo, /* Path ends here */
131141
int directOnly, /* No merge links if true */
132142
int oneWayOnly, /* Parent->child only if true */
133
- Bag *pHidden /* Hidden nodes */
143
+ Bag *pHidden, /* Hidden nodes */
144
+ int branchCost /* Add extra codes to changing branches */
134145
){
135146
Stmt s;
136147
PathNode *pPrev;
137148
PathNode *p;
149
+ int nPriorPeer = 1;
138150
139151
path_reset();
152
+ path.brCost = branchCost;
140153
path.pStart = path_new_node(iFrom, 0, 0);
141154
if( iTo==iFrom ){
142155
path.pEnd = path.pStart;
143156
return path.pStart;
144157
}
@@ -162,14 +175,24 @@
162175
"UNION ALL "
163176
"SELECT pid, 0 FROM plink WHERE cid=:pid"
164177
);
165178
}
166179
while( path.pCurrent ){
167
- path.nStep++;
180
+ if( nPriorPeer ) path.nStep++;
181
+ nPriorPeer = 0;
168182
pPrev = path.pCurrent;
169183
path.pCurrent = 0;
170184
while( pPrev ){
185
+ if( pPrev->nDelay>0 && (nPriorPeer>0 || pPrev->u.pPeer!=0) ){
186
+ PathNode *pThis = pPrev;
187
+ pPrev = pThis->u.pPeer;
188
+ pThis->u.pPeer = path.pCurrent;
189
+ path.pCurrent = pThis;
190
+ pThis->nDelay--;
191
+ continue;
192
+ }
193
+ nPriorPeer++;
171194
db_bind_int(&s, ":pid", pPrev->rid);
172195
while( db_step(&s)==SQLITE_ROW ){
173196
int cid = db_column_int(&s, 0);
174197
int isParent = db_column_int(&s, 1);
175198
if( bag_find(&path.seen, cid) ) continue;
@@ -238,11 +261,11 @@
238261
int cid /* RID for check-in at the end of the path */
239262
){
240263
PathNode *pPath;
241264
int gen = 0;
242265
Stmt ins;
243
- pPath = path_shortest(cid, origid, 1, 0, 0);
266
+ pPath = path_shortest(cid, origid, 1, 0, 0, 0);
244267
db_multi_exec(
245268
"CREATE TEMP TABLE IF NOT EXISTS ancestor("
246269
" rid INT UNIQUE,"
247270
" generation INTEGER PRIMARY KEY"
248271
");"
@@ -273,18 +296,20 @@
273296
int iTo;
274297
PathNode *p;
275298
int n;
276299
int directOnly;
277300
int oneWay;
301
+ const char *zBrCost;
278302
279303
db_find_and_open_repository(0,0);
280304
directOnly = find_option("no-merge",0,0)!=0;
281305
oneWay = find_option("one-way",0,0)!=0;
306
+ zBrCost = find_option("branch-cost",0,1);
282307
if( g.argc!=4 ) usage("VERSION1 VERSION2");
283308
iFrom = name_to_rid(g.argv[2]);
284309
iTo = name_to_rid(g.argv[3]);
285
- p = path_shortest(iFrom, iTo, directOnly, oneWay, 0);
310
+ p = path_shortest(iFrom, iTo, directOnly, oneWay, 0, atoi(zBrCost));
286311
if( p==0 ){
287312
fossil_fatal("no path from %s to %s", g.argv[1], g.argv[2]);
288313
}
289314
for(n=1, p=path.pStart; p; p=p->u.pTo, n++){
290315
char *z;
@@ -453,11 +478,11 @@
453478
}else if(0==iTo){
454479
fossil_fatal("Invalid 'to' RID: 0");
455480
}
456481
if( iFrom==iTo ) return;
457482
path_reset();
458
- p = path_shortest(iFrom, iTo, 1, revOK==0, 0);
483
+ p = path_shortest(iFrom, iTo, 1, revOK==0, 0, 0);
459484
if( p==0 ) return;
460485
path_reverse_path();
461486
db_prepare(&q1,
462487
"SELECT pfnid, fnid FROM mlink"
463488
" WHERE mid=:mid AND (pfnid>0 OR fid==0)"
464489
--- src/path.c
+++ src/path.c
@@ -27,10 +27,12 @@
27 struct PathNode {
28 int rid; /* ID for this node */
29 u8 fromIsParent; /* True if pFrom is the parent of rid */
30 u8 isPrim; /* True if primary side of common ancestor */
31 u8 isHidden; /* Abbreviate output in "fossil bisect ls" */
 
 
32 PathNode *pFrom; /* Node we came from */
33 union {
34 PathNode *pPeer; /* List of nodes of the same generation */
35 PathNode *pTo; /* Next on path from beginning to end */
36 } u;
@@ -45,10 +47,11 @@
45 PathNode *pCurrent; /* Current generation of nodes */
46 PathNode *pAll; /* All nodes */
47 Bag seen; /* Nodes seen before */
48 int nStep; /* Number of steps from first to last */
49 int nNotHidden; /* Number of steps not counting hidden nodes */
 
50 PathNode *pStart; /* Earliest node */
51 PathNode *pEnd; /* Most recent */
52 } path;
53
54 /*
@@ -76,10 +79,16 @@
76 p = fossil_malloc( sizeof(*p) );
77 memset(p, 0, sizeof(*p));
78 p->rid = rid;
79 p->fromIsParent = isParent;
80 p->pFrom = pFrom;
 
 
 
 
 
 
81 p->u.pPeer = path.pCurrent;
82 path.pCurrent = p;
83 p->pAll = path.pAll;
84 path.pAll = p;
85 bag_insert(&path.seen, rid);
@@ -92,10 +101,11 @@
92 void path_reset(void){
93 PathNode *p;
94 while( path.pAll ){
95 p = path.pAll;
96 path.pAll = p->pAll;
 
97 fossil_free(p);
98 }
99 bag_clear(&path.seen);
100 memset(&path, 0, sizeof(path));
101 }
@@ -128,17 +138,20 @@
128 PathNode *path_shortest(
129 int iFrom, /* Path starts here */
130 int iTo, /* Path ends here */
131 int directOnly, /* No merge links if true */
132 int oneWayOnly, /* Parent->child only if true */
133 Bag *pHidden /* Hidden nodes */
 
134 ){
135 Stmt s;
136 PathNode *pPrev;
137 PathNode *p;
 
138
139 path_reset();
 
140 path.pStart = path_new_node(iFrom, 0, 0);
141 if( iTo==iFrom ){
142 path.pEnd = path.pStart;
143 return path.pStart;
144 }
@@ -162,14 +175,24 @@
162 "UNION ALL "
163 "SELECT pid, 0 FROM plink WHERE cid=:pid"
164 );
165 }
166 while( path.pCurrent ){
167 path.nStep++;
 
168 pPrev = path.pCurrent;
169 path.pCurrent = 0;
170 while( pPrev ){
 
 
 
 
 
 
 
 
 
171 db_bind_int(&s, ":pid", pPrev->rid);
172 while( db_step(&s)==SQLITE_ROW ){
173 int cid = db_column_int(&s, 0);
174 int isParent = db_column_int(&s, 1);
175 if( bag_find(&path.seen, cid) ) continue;
@@ -238,11 +261,11 @@
238 int cid /* RID for check-in at the end of the path */
239 ){
240 PathNode *pPath;
241 int gen = 0;
242 Stmt ins;
243 pPath = path_shortest(cid, origid, 1, 0, 0);
244 db_multi_exec(
245 "CREATE TEMP TABLE IF NOT EXISTS ancestor("
246 " rid INT UNIQUE,"
247 " generation INTEGER PRIMARY KEY"
248 ");"
@@ -273,18 +296,20 @@
273 int iTo;
274 PathNode *p;
275 int n;
276 int directOnly;
277 int oneWay;
 
278
279 db_find_and_open_repository(0,0);
280 directOnly = find_option("no-merge",0,0)!=0;
281 oneWay = find_option("one-way",0,0)!=0;
 
282 if( g.argc!=4 ) usage("VERSION1 VERSION2");
283 iFrom = name_to_rid(g.argv[2]);
284 iTo = name_to_rid(g.argv[3]);
285 p = path_shortest(iFrom, iTo, directOnly, oneWay, 0);
286 if( p==0 ){
287 fossil_fatal("no path from %s to %s", g.argv[1], g.argv[2]);
288 }
289 for(n=1, p=path.pStart; p; p=p->u.pTo, n++){
290 char *z;
@@ -453,11 +478,11 @@
453 }else if(0==iTo){
454 fossil_fatal("Invalid 'to' RID: 0");
455 }
456 if( iFrom==iTo ) return;
457 path_reset();
458 p = path_shortest(iFrom, iTo, 1, revOK==0, 0);
459 if( p==0 ) return;
460 path_reverse_path();
461 db_prepare(&q1,
462 "SELECT pfnid, fnid FROM mlink"
463 " WHERE mid=:mid AND (pfnid>0 OR fid==0)"
464
--- src/path.c
+++ src/path.c
@@ -27,10 +27,12 @@
27 struct PathNode {
28 int rid; /* ID for this node */
29 u8 fromIsParent; /* True if pFrom is the parent of rid */
30 u8 isPrim; /* True if primary side of common ancestor */
31 u8 isHidden; /* Abbreviate output in "fossil bisect ls" */
32 u8 nDelay; /* Delay this many steps before walking */
33 char *zBranch; /* Branch name for this node. Might be NULL */
34 PathNode *pFrom; /* Node we came from */
35 union {
36 PathNode *pPeer; /* List of nodes of the same generation */
37 PathNode *pTo; /* Next on path from beginning to end */
38 } u;
@@ -45,10 +47,11 @@
47 PathNode *pCurrent; /* Current generation of nodes */
48 PathNode *pAll; /* All nodes */
49 Bag seen; /* Nodes seen before */
50 int nStep; /* Number of steps from first to last */
51 int nNotHidden; /* Number of steps not counting hidden nodes */
52 u8 brCost; /* Extra cost for moving to a different branch */
53 PathNode *pStart; /* Earliest node */
54 PathNode *pEnd; /* Most recent */
55 } path;
56
57 /*
@@ -76,10 +79,16 @@
79 p = fossil_malloc( sizeof(*p) );
80 memset(p, 0, sizeof(*p));
81 p->rid = rid;
82 p->fromIsParent = isParent;
83 p->pFrom = pFrom;
84 if( path.brCost ){
85 p->zBranch = branch_of_rid(rid);
86 if( pFrom && fossil_strcmp(p->zBranch, pFrom->zBranch)!=0 ){
87 p->nDelay = path.brCost;
88 }
89 }
90 p->u.pPeer = path.pCurrent;
91 path.pCurrent = p;
92 p->pAll = path.pAll;
93 path.pAll = p;
94 bag_insert(&path.seen, rid);
@@ -92,10 +101,11 @@
101 void path_reset(void){
102 PathNode *p;
103 while( path.pAll ){
104 p = path.pAll;
105 path.pAll = p->pAll;
106 fossil_free(p->zBranch);
107 fossil_free(p);
108 }
109 bag_clear(&path.seen);
110 memset(&path, 0, sizeof(path));
111 }
@@ -128,17 +138,20 @@
138 PathNode *path_shortest(
139 int iFrom, /* Path starts here */
140 int iTo, /* Path ends here */
141 int directOnly, /* No merge links if true */
142 int oneWayOnly, /* Parent->child only if true */
143 Bag *pHidden, /* Hidden nodes */
144 int branchCost /* Add extra codes to changing branches */
145 ){
146 Stmt s;
147 PathNode *pPrev;
148 PathNode *p;
149 int nPriorPeer = 1;
150
151 path_reset();
152 path.brCost = branchCost;
153 path.pStart = path_new_node(iFrom, 0, 0);
154 if( iTo==iFrom ){
155 path.pEnd = path.pStart;
156 return path.pStart;
157 }
@@ -162,14 +175,24 @@
175 "UNION ALL "
176 "SELECT pid, 0 FROM plink WHERE cid=:pid"
177 );
178 }
179 while( path.pCurrent ){
180 if( nPriorPeer ) path.nStep++;
181 nPriorPeer = 0;
182 pPrev = path.pCurrent;
183 path.pCurrent = 0;
184 while( pPrev ){
185 if( pPrev->nDelay>0 && (nPriorPeer>0 || pPrev->u.pPeer!=0) ){
186 PathNode *pThis = pPrev;
187 pPrev = pThis->u.pPeer;
188 pThis->u.pPeer = path.pCurrent;
189 path.pCurrent = pThis;
190 pThis->nDelay--;
191 continue;
192 }
193 nPriorPeer++;
194 db_bind_int(&s, ":pid", pPrev->rid);
195 while( db_step(&s)==SQLITE_ROW ){
196 int cid = db_column_int(&s, 0);
197 int isParent = db_column_int(&s, 1);
198 if( bag_find(&path.seen, cid) ) continue;
@@ -238,11 +261,11 @@
261 int cid /* RID for check-in at the end of the path */
262 ){
263 PathNode *pPath;
264 int gen = 0;
265 Stmt ins;
266 pPath = path_shortest(cid, origid, 1, 0, 0, 0);
267 db_multi_exec(
268 "CREATE TEMP TABLE IF NOT EXISTS ancestor("
269 " rid INT UNIQUE,"
270 " generation INTEGER PRIMARY KEY"
271 ");"
@@ -273,18 +296,20 @@
296 int iTo;
297 PathNode *p;
298 int n;
299 int directOnly;
300 int oneWay;
301 const char *zBrCost;
302
303 db_find_and_open_repository(0,0);
304 directOnly = find_option("no-merge",0,0)!=0;
305 oneWay = find_option("one-way",0,0)!=0;
306 zBrCost = find_option("branch-cost",0,1);
307 if( g.argc!=4 ) usage("VERSION1 VERSION2");
308 iFrom = name_to_rid(g.argv[2]);
309 iTo = name_to_rid(g.argv[3]);
310 p = path_shortest(iFrom, iTo, directOnly, oneWay, 0, atoi(zBrCost));
311 if( p==0 ){
312 fossil_fatal("no path from %s to %s", g.argv[1], g.argv[2]);
313 }
314 for(n=1, p=path.pStart; p; p=p->u.pTo, n++){
315 char *z;
@@ -453,11 +478,11 @@
478 }else if(0==iTo){
479 fossil_fatal("Invalid 'to' RID: 0");
480 }
481 if( iFrom==iTo ) return;
482 path_reset();
483 p = path_shortest(iFrom, iTo, 1, revOK==0, 0, 0);
484 if( p==0 ) return;
485 path_reverse_path();
486 db_prepare(&q1,
487 "SELECT pfnid, fnid FROM mlink"
488 " WHERE mid=:mid AND (pfnid>0 OR fid==0)"
489
+4 -3
--- src/timeline.c
+++ src/timeline.c
@@ -2073,20 +2073,21 @@
20732073
const char *zTo = 0;
20742074
Blob ins;
20752075
int nNodeOnPath = 0;
20762076
int commonAncs = 0; /* Common ancestors of me_rid and you_rid. */
20772077
int earlierRid = 0, laterRid = 0;
2078
+ int cost = bMin ? 100 : 0;
20782079
20792080
if( from_rid && to_rid ){
20802081
if( from_to_mode==0 ){
2081
- p = path_shortest(from_rid, to_rid, noMerge, 0, 0);
2082
+ p = path_shortest(from_rid, to_rid, noMerge, 0, 0, cost);
20822083
}else if( from_to_mode==1 ){
2083
- p = path_shortest(from_rid, to_rid, 0, 1, 0);
2084
+ p = path_shortest(from_rid, to_rid, 0, 1, 0, cost);
20842085
earlierRid = commonAncs = from_rid;
20852086
laterRid = to_rid;
20862087
}else{
2087
- p = path_shortest(to_rid, from_rid, 0, 1, 0);
2088
+ p = path_shortest(to_rid, from_rid, 0, 1, 0, cost);
20882089
earlierRid = commonAncs = to_rid;
20892090
laterRid = from_rid;
20902091
}
20912092
zFrom = P("from");
20922093
zTo = zTo2 ? zTo2 : P("to");
20932094
--- src/timeline.c
+++ src/timeline.c
@@ -2073,20 +2073,21 @@
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
2079 if( from_rid && to_rid ){
2080 if( from_to_mode==0 ){
2081 p = path_shortest(from_rid, to_rid, noMerge, 0, 0);
2082 }else if( from_to_mode==1 ){
2083 p = path_shortest(from_rid, to_rid, 0, 1, 0);
2084 earlierRid = commonAncs = from_rid;
2085 laterRid = to_rid;
2086 }else{
2087 p = path_shortest(to_rid, from_rid, 0, 1, 0);
2088 earlierRid = commonAncs = to_rid;
2089 laterRid = from_rid;
2090 }
2091 zFrom = P("from");
2092 zTo = zTo2 ? zTo2 : P("to");
2093
--- src/timeline.c
+++ src/timeline.c
@@ -2073,20 +2073,21 @@
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 ? 100 : 0;
2079
2080 if( from_rid && to_rid ){
2081 if( from_to_mode==0 ){
2082 p = path_shortest(from_rid, to_rid, noMerge, 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{
2088 p = path_shortest(to_rid, from_rid, 0, 1, 0, cost);
2089 earlierRid = commonAncs = to_rid;
2090 laterRid = from_rid;
2091 }
2092 zFrom = P("from");
2093 zTo = zTo2 ? zTo2 : P("to");
2094

Keyboard Shortcuts

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