Fossil SCM

Fix a bug in mlink table building during "rebuild". If a check-in and its parent are both deltas of the same baseline and the child reverts to baseline after a change in the parent, be sure to capture this change in the mlink table. This is the correct fix for the errant fix_mlink branch.

drh 2011-11-03 14:22 trunk
Commit d084043f798277760682287020c4455b73629b0d
1 file changed +22 -7
+22 -7
--- src/manifest.c
+++ src/manifest.c
@@ -1334,18 +1334,33 @@
13341334
}
13351335
}
13361336
}
13371337
if( pParent->zBaseline && pChild->zBaseline ){
13381338
/* Both parent and child are delta manifests. Look for files that
1339
- ** are marked as deleted in the parent but which reappear in the child
1340
- ** and show such files as being added in the child. */
1339
+ ** are deleted or modified in the parent but which reappear or revert
1340
+ ** to baseline in the child and show such files as being added or changed
1341
+ ** in the child. */
13411342
for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){
1342
- if( pParentFile->zUuid ) continue;
1343
- pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1344
- if( pChildFile ){
1345
- add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1346
- isPublic, manifest_file_mperm(pChildFile));
1343
+ if( pParentFile->zUuid ){
1344
+ pChildFile = manifest_file_seek_base(pChild, pParentFile->zName);
1345
+ if( pChildFile==0 ){
1346
+ /* The child file reverts to baseline. Show this as a change */
1347
+ pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1348
+ if( pChildFile ){
1349
+ add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
1350
+ pChildFile->zName, 0, isPublic,
1351
+ manifest_file_mperm(pChildFile));
1352
+ }
1353
+ }
1354
+ }else{
1355
+ pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1356
+ if( pChildFile ){
1357
+ /* File resurrected in the child after having been deleted in
1358
+ ** the parent. Show this as an added file. */
1359
+ add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1360
+ isPublic, manifest_file_mperm(pChildFile));
1361
+ }
13471362
}
13481363
}
13491364
}else if( pChild->zBaseline==0 ){
13501365
/* pChild is a baseline. Look for files that are present in pParent
13511366
** but are missing from pChild and mark them as having been deleted. */
13521367
--- src/manifest.c
+++ src/manifest.c
@@ -1334,18 +1334,33 @@
1334 }
1335 }
1336 }
1337 if( pParent->zBaseline && pChild->zBaseline ){
1338 /* Both parent and child are delta manifests. Look for files that
1339 ** are marked as deleted in the parent but which reappear in the child
1340 ** and show such files as being added in the child. */
 
1341 for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){
1342 if( pParentFile->zUuid ) continue;
1343 pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1344 if( pChildFile ){
1345 add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1346 isPublic, manifest_file_mperm(pChildFile));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1347 }
1348 }
1349 }else if( pChild->zBaseline==0 ){
1350 /* pChild is a baseline. Look for files that are present in pParent
1351 ** but are missing from pChild and mark them as having been deleted. */
1352
--- src/manifest.c
+++ src/manifest.c
@@ -1334,18 +1334,33 @@
1334 }
1335 }
1336 }
1337 if( pParent->zBaseline && pChild->zBaseline ){
1338 /* Both parent and child are delta manifests. Look for files that
1339 ** are deleted or modified in the parent but which reappear or revert
1340 ** to baseline in the child and show such files as being added or changed
1341 ** in the child. */
1342 for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){
1343 if( pParentFile->zUuid ){
1344 pChildFile = manifest_file_seek_base(pChild, pParentFile->zName);
1345 if( pChildFile==0 ){
1346 /* The child file reverts to baseline. Show this as a change */
1347 pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1348 if( pChildFile ){
1349 add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
1350 pChildFile->zName, 0, isPublic,
1351 manifest_file_mperm(pChildFile));
1352 }
1353 }
1354 }else{
1355 pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1356 if( pChildFile ){
1357 /* File resurrected in the child after having been deleted in
1358 ** the parent. Show this as an added file. */
1359 add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1360 isPublic, manifest_file_mperm(pChildFile));
1361 }
1362 }
1363 }
1364 }else if( pChild->zBaseline==0 ){
1365 /* pChild is a baseline. Look for files that are present in pParent
1366 ** but are missing from pChild and mark them as having been deleted. */
1367

Keyboard Shortcuts

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