Fossil SCM

Fix the file name change detection logic so that it works the same in either direction on the DAG. Ticket [c9d454153eea969]

drh 2011-01-04 13:59 trunk
Commit 44766975234ece0a81e96e0d227f4b9980074938
1 file changed +9 -4
+9 -4
--- src/bisect.c
+++ src/bisect.c
@@ -337,13 +337,14 @@
337337
/*
338338
** Compute all file name changes that occur going from checkin iFrom
339339
** to checkin iTo.
340340
**
341341
** The number of name changes is written into *pnChng. For each name
342
-** change, to integers are allocated for *piChng. The first is the original
343
-** name and the second is the new name. Space to hold *piChng is obtained
344
-** from fossil_malloc() and should be released by the caller.
342
+** change, two integers are allocated for *piChng. The first is the
343
+** filename.fnid for the original name and the second is for new name.
344
+** Space to hold *piChng is obtained from fossil_malloc() and should
345
+** be released by the caller.
345346
**
346347
** This routine really has nothing to do with bisection. It is located
347348
** in this bisect.c module in order to leverage some of the bisect
348349
** infrastructure.
349350
*/
@@ -368,12 +369,16 @@
368369
if( p==0 ) return;
369370
bisect_reverse_path();
370371
db_prepare(&q1,
371372
"SELECT pfnid, fnid FROM mlink WHERE mid=:mid AND pfnid>0"
372373
);
373
- for(p=bisect.pStart->u.pTo; p; p=p->u.pTo){
374
+ for(p=bisect.pStart; p; p=p->u.pTo){
374375
int fnid, pfnid;
376
+ if( !p->fromIsParent && (p->u.pTo==0 || p->u.pTo->fromIsParent) ){
377
+ /* Skip nodes where the parent is not on the path */
378
+ continue;
379
+ }
375380
db_bind_int(&q1, ":mid", p->rid);
376381
while( db_step(&q1)==SQLITE_ROW ){
377382
if( p->fromIsParent ){
378383
fnid = db_column_int(&q1, 1);
379384
pfnid = db_column_int(&q1, 0);
380385
--- src/bisect.c
+++ src/bisect.c
@@ -337,13 +337,14 @@
337 /*
338 ** Compute all file name changes that occur going from checkin iFrom
339 ** to checkin iTo.
340 **
341 ** The number of name changes is written into *pnChng. For each name
342 ** change, to integers are allocated for *piChng. The first is the original
343 ** name and the second is the new name. Space to hold *piChng is obtained
344 ** from fossil_malloc() and should be released by the caller.
 
345 **
346 ** This routine really has nothing to do with bisection. It is located
347 ** in this bisect.c module in order to leverage some of the bisect
348 ** infrastructure.
349 */
@@ -368,12 +369,16 @@
368 if( p==0 ) return;
369 bisect_reverse_path();
370 db_prepare(&q1,
371 "SELECT pfnid, fnid FROM mlink WHERE mid=:mid AND pfnid>0"
372 );
373 for(p=bisect.pStart->u.pTo; p; p=p->u.pTo){
374 int fnid, pfnid;
 
 
 
 
375 db_bind_int(&q1, ":mid", p->rid);
376 while( db_step(&q1)==SQLITE_ROW ){
377 if( p->fromIsParent ){
378 fnid = db_column_int(&q1, 1);
379 pfnid = db_column_int(&q1, 0);
380
--- src/bisect.c
+++ src/bisect.c
@@ -337,13 +337,14 @@
337 /*
338 ** Compute all file name changes that occur going from checkin iFrom
339 ** to checkin iTo.
340 **
341 ** The number of name changes is written into *pnChng. For each name
342 ** change, two integers are allocated for *piChng. The first is the
343 ** filename.fnid for the original name and the second is for new name.
344 ** Space to hold *piChng is obtained from fossil_malloc() and should
345 ** be released by the caller.
346 **
347 ** This routine really has nothing to do with bisection. It is located
348 ** in this bisect.c module in order to leverage some of the bisect
349 ** infrastructure.
350 */
@@ -368,12 +369,16 @@
369 if( p==0 ) return;
370 bisect_reverse_path();
371 db_prepare(&q1,
372 "SELECT pfnid, fnid FROM mlink WHERE mid=:mid AND pfnid>0"
373 );
374 for(p=bisect.pStart; p; p=p->u.pTo){
375 int fnid, pfnid;
376 if( !p->fromIsParent && (p->u.pTo==0 || p->u.pTo->fromIsParent) ){
377 /* Skip nodes where the parent is not on the path */
378 continue;
379 }
380 db_bind_int(&q1, ":mid", p->rid);
381 while( db_step(&q1)==SQLITE_ROW ){
382 if( p->fromIsParent ){
383 fnid = db_column_int(&q1, 1);
384 pfnid = db_column_int(&q1, 0);
385

Keyboard Shortcuts

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