Mercurial > hg
diff tests/test-obsolete.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 | f924dd043974 |
children | fce4ed2912bb |
line wrap: on
line diff
--- a/tests/test-obsolete.t Thu Jun 22 10:10:02 2017 -0700 +++ b/tests/test-obsolete.t Thu Jun 15 00:15:52 2017 -0700 @@ -1239,6 +1239,8 @@ obsmarkers -- 'sortdict()' version: 1 (70 bytes) f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} + phase-heads -- 'sortdict()' + f27abbcc1f77fb409cf9160482fe619541e2d605 draft $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg pulling from .hg/strip-backup/e008cf283490-39c978dc-backup.hg @@ -1283,6 +1285,8 @@ version: 1 (139 bytes) e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} + phase-heads -- 'sortdict()' + b0551702f918510f01ae838ab03a463054c67b46 draft $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg adding changesets