diff tests/test-bundle-phases.t @ 33032: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 e8c8d81eb864
children e3867c712d51
line wrap: on
line diff
--- a/tests/test-bundle-phases.t	Thu Jun 22 10:10:02 2017 -0700
+++ b/tests/test-bundle-phases.t	Thu Jun 15 00:15:52 2017 -0700
@@ -170,6 +170,32 @@
   |
   o  A public
   
+Unbundling change in the middle of a stack does not affect later changes
+  $ hg strip --no-backup E
+  $ hg phase --secret --force D
+  $ hg log -G -T '{desc} {phase}\n'
+  o  D secret
+  |
+  o  C draft
+  |
+  o  B draft
+  |
+  o  A public
+  
+  $ hg bundle --base A -r B bundle
+  1 changesets found
+  $ hg unbundle -q bundle
+  $ rm bundle
+  $ hg log -G -T '{desc} {phase}\n'
+  o  D secret
+  |
+  o  C draft
+  |
+  o  B draft
+  |
+  o  A public
+  
+
   $ cd ..
 
 Set up repo with non-linear history