Fossil SCM
Fix the file name change detection logic so that it works the same in either direction on the DAG. Ticket [c9d454153eea969]
Commit
44766975234ece0a81e96e0d227f4b9980074938
Parent
d394120c42ddf1b…
1 file changed
+9
-4
+9
-4
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -337,13 +337,14 @@ | ||
| 337 | 337 | /* |
| 338 | 338 | ** Compute all file name changes that occur going from checkin iFrom |
| 339 | 339 | ** to checkin iTo. |
| 340 | 340 | ** |
| 341 | 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. | |
| 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. | |
| 345 | 346 | ** |
| 346 | 347 | ** This routine really has nothing to do with bisection. It is located |
| 347 | 348 | ** in this bisect.c module in order to leverage some of the bisect |
| 348 | 349 | ** infrastructure. |
| 349 | 350 | */ |
| @@ -368,12 +369,16 @@ | ||
| 368 | 369 | if( p==0 ) return; |
| 369 | 370 | bisect_reverse_path(); |
| 370 | 371 | db_prepare(&q1, |
| 371 | 372 | "SELECT pfnid, fnid FROM mlink WHERE mid=:mid AND pfnid>0" |
| 372 | 373 | ); |
| 373 | - for(p=bisect.pStart->u.pTo; p; p=p->u.pTo){ | |
| 374 | + for(p=bisect.pStart; p; p=p->u.pTo){ | |
| 374 | 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 | + } | |
| 375 | 380 | db_bind_int(&q1, ":mid", p->rid); |
| 376 | 381 | while( db_step(&q1)==SQLITE_ROW ){ |
| 377 | 382 | if( p->fromIsParent ){ |
| 378 | 383 | fnid = db_column_int(&q1, 1); |
| 379 | 384 | pfnid = db_column_int(&q1, 0); |
| 380 | 385 |
| --- 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 |