Mercurial > hg-stable
comparison tests/test-strip.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 | 1b5c61d38a52 |
children | fcd1c483f5ea |
comparison
equal
deleted
inserted
replaced
33043:e8c8d81eb864 | 33044:8e3021fd1a44 |
---|---|
211 | 211 |
212 $ hg debugbundle .hg/strip-backup/* | 212 $ hg debugbundle .hg/strip-backup/* |
213 Stream params: sortdict([('Compression', 'BZ')]) | 213 Stream params: sortdict([('Compression', 'BZ')]) |
214 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])" | 214 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])" |
215 264128213d290d868c54642d13aeaa3675551a78 | 215 264128213d290d868c54642d13aeaa3675551a78 |
216 phase-heads -- 'sortdict()' | |
217 264128213d290d868c54642d13aeaa3675551a78 draft | |
216 $ hg pull .hg/strip-backup/* | 218 $ hg pull .hg/strip-backup/* |
217 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg | 219 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg |
218 searching for changes | 220 searching for changes |
219 adding changesets | 221 adding changesets |
220 adding manifests | 222 adding manifests |
837 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | 839 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
838 2 changesets found | 840 2 changesets found |
839 list of changesets: | 841 list of changesets: |
840 6625a516847449b6f0fa3737b9ba56e9f0f3032c | 842 6625a516847449b6f0fa3737b9ba56e9f0f3032c |
841 d8db9d1372214336d2b5570f20ee468d2c72fa8b | 843 d8db9d1372214336d2b5570f20ee468d2c72fa8b |
842 bundle2-output-bundle: "HG20", (1 params) 1 parts total | 844 bundle2-output-bundle: "HG20", (1 params) 2 parts total |
843 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload | 845 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload |
846 bundle2-output-part: "phase-heads" 24 bytes payload | |
844 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob) | 847 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob) |
845 updating the branch cache | 848 updating the branch cache |
846 invalid branchheads cache (served): tip differs | 849 invalid branchheads cache (served): tip differs |
847 truncating cache/rbc-revs-v1 to 24 | 850 truncating cache/rbc-revs-v1 to 24 |
848 $ hg log -G | 851 $ hg log -G |