comparison tests/test-obsolete.t @ 33044:8e3021fd1a44

strip: include phases in bundle (BC) Before this patch, unbundling a stripped changeset would make it a draft (unless the parent was secret). This meant that one would lose phase information when stripping and unbundling secret changesets. The same thing was true for public changesets. While stripping public changesets is generally rare, it's done frequently by e.g. the narrowhg extension. We also include the phases in the temporary bundle, just in case stripping were to fail after that point, so the user can still restore the repo including phase information. Before this patch, the phases were left untouched during the bundling and unbundling of the temporary bundle. Only at the end of the transaction would phasecache.filterunknown() be called to remove phase roots that were no longer valid. We now need to call that also after the first stripping, i.e. before applying the temporary bundle. Otherwise unbundling the temporary bundle will cause a read of the phase cache which has stripped changesets in the cache and that fails. Like with obsmarkers, we unconditionally include the phases in the bundle when stripping (when using bundle2, such as when generaldelta is enabled). The reason for doing that for strip but not for bundle is that strip bundles are not meant to be shared outside the repo, so we don't care as much about compatibility.
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 15 Jun 2017 00:15:52 -0700
parents f924dd043974
children fce4ed2912bb
comparison
equal deleted inserted replaced
33043:e8c8d81eb864 33044:8e3021fd1a44
1237 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 1237 e008cf2834908e5d6b0f792a9d4b0e2272260fb8
1238 f27abbcc1f77fb409cf9160482fe619541e2d605 1238 f27abbcc1f77fb409cf9160482fe619541e2d605
1239 obsmarkers -- 'sortdict()' 1239 obsmarkers -- 'sortdict()'
1240 version: 1 (70 bytes) 1240 version: 1 (70 bytes)
1241 f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 1241 f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1242 phase-heads -- 'sortdict()'
1243 f27abbcc1f77fb409cf9160482fe619541e2d605 draft
1242 1244
1243 $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg 1245 $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg
1244 pulling from .hg/strip-backup/e008cf283490-39c978dc-backup.hg 1246 pulling from .hg/strip-backup/e008cf283490-39c978dc-backup.hg
1245 searching for changes 1247 searching for changes
1246 no changes found 1248 no changes found
1281 b0551702f918510f01ae838ab03a463054c67b46 1283 b0551702f918510f01ae838ab03a463054c67b46
1282 obsmarkers -- 'sortdict()' 1284 obsmarkers -- 'sortdict()'
1283 version: 1 (139 bytes) 1285 version: 1 (139 bytes)
1284 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 1286 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1285 f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 1287 f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1288 phase-heads -- 'sortdict()'
1289 b0551702f918510f01ae838ab03a463054c67b46 draft
1286 1290
1287 $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg 1291 $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg
1288 adding changesets 1292 adding changesets
1289 adding manifests 1293 adding manifests
1290 adding file changes 1294 adding file changes