Fossil SCM

Trying to fix some cases where the mlink table is bad build due to delta manifests. In this checkin, I fix the case when the child delta manifest changed back the file from some contents to those of its baseline manifest. The 'info' page was not showing these kind of changes.

viriketo 2011-11-02 21:53 trunk
Commit cf5f2c4ea6cd562387aa5b77b16c871d5aca09f0
1 file changed +14 -4
+14 -4
--- src/manifest.c
+++ src/manifest.c
@@ -1335,17 +1335,27 @@
13351335
}
13361336
}
13371337
if( pParent->zBaseline && pChild->zBaseline ){
13381338
/* Both parent and child are delta manifests. Look for files that
13391339
** are marked as deleted in the parent but which reappear in the child
1340
- ** and show such files as being added in the child. */
1340
+ ** and show such files as being added in the child.
1341
+ ** Also look for different uuids in the parent, to show that
1342
+ ** the file contents were back those of the baseline */
13411343
for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){
1342
- if( pParentFile->zUuid ) continue;
13431344
pChildFile = manifest_file_seek(pChild, pParentFile->zName);
13441345
if( pChildFile ){
1345
- add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1346
- isPublic, manifest_file_mperm(pChildFile));
1346
+ int mperm = manifest_file_mperm(pChildFile);
1347
+ if( !pParentFile->zUuid ){
1348
+ /* File added to the child */
1349
+ add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1350
+ isPublic, manifest_file_mperm(pChildFile));
1351
+ }else if( fossil_strcmp(pChildFile->zUuid, pParentFile->zUuid) !=0
1352
+ || manifest_file_mperm(pChildFile)!=mperm ){
1353
+ /* File changed in the child back to the baseline uuid or perms */
1354
+ add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
1355
+ pChildFile->zName, 0, isPublic, mperm);
1356
+ }
13471357
}
13481358
}
13491359
}else if( pChild->zBaseline==0 ){
13501360
/* pChild is a baseline. Look for files that are present in pParent
13511361
** but are missing from pChild and mark them as having been deleted. */
13521362
--- src/manifest.c
+++ src/manifest.c
@@ -1335,17 +1335,27 @@
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
@@ -1335,17 +1335,27 @@
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 ** Also look for different uuids in the parent, to show that
1342 ** the file contents were back those of the baseline */
1343 for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){
 
1344 pChildFile = manifest_file_seek(pChild, pParentFile->zName);
1345 if( pChildFile ){
1346 int mperm = manifest_file_mperm(pChildFile);
1347 if( !pParentFile->zUuid ){
1348 /* File added to the child */
1349 add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0,
1350 isPublic, manifest_file_mperm(pChildFile));
1351 }else if( fossil_strcmp(pChildFile->zUuid, pParentFile->zUuid) !=0
1352 || manifest_file_mperm(pChildFile)!=mperm ){
1353 /* File changed in the child back to the baseline uuid or perms */
1354 add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid,
1355 pChildFile->zName, 0, isPublic, mperm);
1356 }
1357 }
1358 }
1359 }else if( pChild->zBaseline==0 ){
1360 /* pChild is a baseline. Look for files that are present in pParent
1361 ** but are missing from pChild and mark them as having been deleted. */
1362

Keyboard Shortcuts

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