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.
Commit
cf5f2c4ea6cd562387aa5b77b16c871d5aca09f0
Parent
83a574b019b02b2…
1 file changed
+14
-4
+14
-4
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1335,17 +1335,27 @@ | ||
| 1335 | 1335 | } |
| 1336 | 1336 | } |
| 1337 | 1337 | if( pParent->zBaseline && pChild->zBaseline ){ |
| 1338 | 1338 | /* Both parent and child are delta manifests. Look for files that |
| 1339 | 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. */ | |
| 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 */ | |
| 1341 | 1343 | for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){ |
| 1342 | - if( pParentFile->zUuid ) continue; | |
| 1343 | 1344 | pChildFile = manifest_file_seek(pChild, pParentFile->zName); |
| 1344 | 1345 | 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 | + } | |
| 1347 | 1357 | } |
| 1348 | 1358 | } |
| 1349 | 1359 | }else if( pChild->zBaseline==0 ){ |
| 1350 | 1360 | /* pChild is a baseline. Look for files that are present in pParent |
| 1351 | 1361 | ** but are missing from pChild and mark them as having been deleted. */ |
| 1352 | 1362 |
| --- 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 |