Fossil

Check-in [44766975]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the file name change detection logic so that it works the same in either direction on the DAG. Ticket [c9d454153eea969]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:44766975234ece0a81e96e0d227f4b9980074938
User & Date: drh 2011-01-04 13:59:59
Context
2011-01-04
14:12
Fix the merge command so that file renames are only considered if they are on the shortest path between the pivot and the checkins being merged. Ticket [74413366fe5067b3d]. check-in: ff2a8710 user: drh tags: trunk
13:59
Fix the file name change detection logic so that it works the same in either direction on the DAG. Ticket [c9d454153eea969] check-in: 44766975 user: drh tags: trunk
2011-01-03
22:23
Fix the fossil_print() interface to use the internal printf() implementation (which we control) rather than the system printf() since might vary from one platform to the next. Ticket [6883bdd1eff926009c] check-in: d394120c user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/bisect.c.

335
336
337
338
339
340
341
342

343
344
345
346
347
348
349
350
351
...
366
367
368
369
370
371
372
373
374




375
376
377
378
379
380
381
};

/*
** Compute all file name changes that occur going from checkin iFrom
** to checkin iTo.
**
** The number of name changes is written into *pnChng.  For each name
** change, to integers are allocated for *piChng.  The first is the original

** name and the second is the new name.  Space to hold *piChng is obtained
** from fossil_malloc() and should be released by the caller.
**
** This routine really has nothing to do with bisection.  It is located
** in this bisect.c module in order to leverage some of the bisect
** infrastructure.
*/
void find_filename_changes(
  int iFrom,
................................................................................
  bisect_reset();
  p = bisect_shortest_path(iFrom, iTo, 1);
  if( p==0 ) return;
  bisect_reverse_path();
  db_prepare(&q1,
     "SELECT pfnid, fnid FROM mlink WHERE mid=:mid AND pfnid>0"
  );
  for(p=bisect.pStart->u.pTo; p; p=p->u.pTo){
    int fnid, pfnid;




    db_bind_int(&q1, ":mid", p->rid);
    while( db_step(&q1)==SQLITE_ROW ){
      if( p->fromIsParent ){
        fnid = db_column_int(&q1, 1);
        pfnid = db_column_int(&q1, 0);
      }else{
        fnid = db_column_int(&q1, 0);







|
>
|
|







 







|

>
>
>
>







335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
...
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
};

/*
** Compute all file name changes that occur going from checkin iFrom
** to checkin iTo.
**
** The number of name changes is written into *pnChng.  For each name
** change, two integers are allocated for *piChng.  The first is the 
** filename.fnid for the original name and the second is for new name.
** Space to hold *piChng is obtained from fossil_malloc() and should
** be released by the caller.
**
** This routine really has nothing to do with bisection.  It is located
** in this bisect.c module in order to leverage some of the bisect
** infrastructure.
*/
void find_filename_changes(
  int iFrom,
................................................................................
  bisect_reset();
  p = bisect_shortest_path(iFrom, iTo, 1);
  if( p==0 ) return;
  bisect_reverse_path();
  db_prepare(&q1,
     "SELECT pfnid, fnid FROM mlink WHERE mid=:mid AND pfnid>0"
  );
  for(p=bisect.pStart; p; p=p->u.pTo){
    int fnid, pfnid;
    if( !p->fromIsParent && (p->u.pTo==0 || p->u.pTo->fromIsParent) ){
      /* Skip nodes where the parent is not on the path */
      continue;
    }
    db_bind_int(&q1, ":mid", p->rid);
    while( db_step(&q1)==SQLITE_ROW ){
      if( p->fromIsParent ){
        fnid = db_column_int(&q1, 1);
        pfnid = db_column_int(&q1, 0);
      }else{
        fnid = db_column_int(&q1, 0);