Fossil

Check-in [66951fa6]
Login

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

Overview
Comment:Fix a bug in the merge file-rename detection logic, a bug introduced by the path refactoring changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 66951fa6bd0d7a93a5ee8ac807391de4b2d8903c
User & Date: drh 2011-03-14 13:22:49
Context
2011-03-14
18:26
Improvements to the layout of merge arrows in the graph. check-in: 313cd3c8 user: drh tags: trunk
13:22
Fix a bug in the merge file-rename detection logic, a bug introduced by the path refactoring changes. check-in: 66951fa6 user: drh tags: trunk
12:42
Merge the path-refactor changes into trunk. Refactoring is not complete, but it appears to be stable. check-in: e5121b47 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/path.c.

124
125
126
127
128
129
130


131

132
133
134
135
136
137
138
...
358
359
360
361
362
363
364

365
366
367
368
369
370
371
PathNode *path_shortest(int iFrom, int iTo, int directOnly){
  Stmt s;
  PathNode *pPrev;
  PathNode *p;

  path_reset();
  path.pStart = path_new_node(iFrom, 0, 0);


  if( iTo==iFrom ) return path.pStart;

  if( directOnly ){
    db_prepare(&s, 
        "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim "
        "UNION ALL "
        "SELECT pid, 0 FROM plink WHERE cid=:pid AND isprim"
    );
  }else{
................................................................................
  int nChng = 0;           /* Number of files whose names have changed */
  int *aChng;              /* Two integers per name change */
  int i;                   /* Loop counter */
  Stmt q1;                 /* Query of name changes */

  *pnChng = 0;
  *aiChng = 0;

  path_reset();
  p = path_shortest(iFrom, iTo, 0);
  if( p==0 ) return;
  path_reverse_path();
  db_prepare(&q1,
     "SELECT pfnid, fnid FROM mlink WHERE mid=:mid AND pfnid>0"
  );







>
>
|
>







 







>







124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
...
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
PathNode *path_shortest(int iFrom, int iTo, int directOnly){
  Stmt s;
  PathNode *pPrev;
  PathNode *p;

  path_reset();
  path.pStart = path_new_node(iFrom, 0, 0);
  if( iTo==iFrom ){
    path.pEnd = path.pStart;
    return path.pStart;
  }
  if( directOnly ){
    db_prepare(&s, 
        "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim "
        "UNION ALL "
        "SELECT pid, 0 FROM plink WHERE cid=:pid AND isprim"
    );
  }else{
................................................................................
  int nChng = 0;           /* Number of files whose names have changed */
  int *aChng;              /* Two integers per name change */
  int i;                   /* Loop counter */
  Stmt q1;                 /* Query of name changes */

  *pnChng = 0;
  *aiChng = 0;
  if( iFrom==iTo ) return;
  path_reset();
  p = path_shortest(iFrom, iTo, 0);
  if( p==0 ) return;
  path_reverse_path();
  db_prepare(&q1,
     "SELECT pfnid, fnid FROM mlink WHERE mid=:mid AND pfnid>0"
  );