comparison 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
comparison
equal deleted inserted replaced
33031:e8c8d81eb864 33032:8e3021fd1a44
168 | 168 |
169 o B draft 169 o B draft
170 | 170 |
171 o A public 171 o A public
172 172
173 Unbundling change in the middle of a stack does not affect later changes
174 $ hg strip --no-backup E
175 $ hg phase --secret --force D
176 $ hg log -G -T '{desc} {phase}\n'
177 o D secret
178 |
179 o C draft
180 |
181 o B draft
182 |
183 o A public
184
185 $ hg bundle --base A -r B bundle
186 1 changesets found
187 $ hg unbundle -q bundle
188 $ rm bundle
189 $ hg log -G -T '{desc} {phase}\n'
190 o D secret
191 |
192 o C draft
193 |
194 o B draft
195 |
196 o A public
197
198
173 $ cd .. 199 $ cd ..
174 200
175 Set up repo with non-linear history 201 Set up repo with non-linear history
176 $ hg init non-linear 202 $ hg init non-linear
177 $ cd non-linear 203 $ cd non-linear