Mercurial > hg
diff tests/test-obsolete.t @ 32629:71eb6a098315
strip: strip obsmarkers exclusive to the stripped changeset
This is it, `hg strip --rev X` will now also remove obsolescence markers
exclusive to X. Since a previous changeset, the obsmarkers has been backed up
in the strip backup bundle, so it is possible to restore them.
Note: stripping obsmarkers means the precursors of the stripped changeset might no
longer be obsolete after the strip.
Stripping changeset without obsmarkers can be useful when building test case. So
It is possible to disable the stripping of obsmarkers using the
'devel.strip-obsmarkers' config option.
Test change have been carefully validated.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 20 May 2017 16:19:59 +0200 |
parents | 00a7f7b1af9c |
children | 8f83f924ee1c |
line wrap: on
line diff
--- a/tests/test-obsolete.t Thu Jun 01 12:08:49 2017 +0200 +++ b/tests/test-obsolete.t Sat May 20 16:19:59 2017 +0200 @@ -1211,35 +1211,88 @@ o 0:a78f55e5508c (draft) [ ] 0 + $ hg strip --hidden -r 2 --config extensions.strip= --config devel.strip-obsmarkers=no + saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e008cf283490-39c978dc-backup.hg (glob) + $ hg debugobsolete + e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob) + f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob) + $ hg log -G + @ 2:b0551702f918 (draft) [tip ] 2 + | + o 1:e016b03fd86f (draft) [ ] 1 + | + o 0:a78f55e5508c (draft) [ ] 0 + + $ hg log -G --hidden + @ 2:b0551702f918 (draft) [tip ] 2 + | + o 1:e016b03fd86f (draft) [ ] 1 + | + o 0:a78f55e5508c (draft) [ ] 0 + + $ hg debugbundle .hg/strip-backup/e008cf283490-*-backup.hg + Stream params: sortdict([('Compression', 'BZ')]) + changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])" + e008cf2834908e5d6b0f792a9d4b0e2272260fb8 + f27abbcc1f77fb409cf9160482fe619541e2d605 + obsmarkers -- 'sortdict()' + version: 1 (70 bytes) + f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} + + $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg + pulling from .hg/strip-backup/e008cf283490-39c978dc-backup.hg + searching for changes + no changes found + $ hg debugobsolete + e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob) + f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob) + $ hg log -G + @ 2:b0551702f918 (draft) [tip ] 2 + | + o 1:e016b03fd86f (draft) [ ] 1 + | + o 0:a78f55e5508c (draft) [ ] 0 + + $ hg log -G --hidden + @ 2:b0551702f918 (draft) [tip ] 2 + | + o 1:e016b03fd86f (draft) [ ] 1 + | + o 0:a78f55e5508c (draft) [ ] 0 + + +Testing that strip remove markers: + $ hg strip -r 1 --config extensions.strip= 0 files updated, 0 files merged, 2 files removed, 0 files unresolved - saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg (glob) + saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-65ede734-backup.hg (glob) + $ hg debugobsolete $ hg log -G @ 0:a78f55e5508c (draft) [tip ] 0 $ hg log -G --hidden @ 0:a78f55e5508c (draft) [tip ] 0 - $ hg debugbundle .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg + $ hg debugbundle .hg/strip-backup/e016b03fd86f-*-backup.hg Stream params: sortdict([('Compression', 'BZ')]) - changegroup -- "sortdict([('version', '02'), ('nbchanges', '4')])" + changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])" e016b03fd86fcccc54817d120b90b751aaf367d6 - e008cf2834908e5d6b0f792a9d4b0e2272260fb8 - f27abbcc1f77fb409cf9160482fe619541e2d605 b0551702f918510f01ae838ab03a463054c67b46 obsmarkers -- 'sortdict()' 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'} - $ hg pull .hg/strip-backup/* - pulling from .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg - searching for changes + $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files + 2 new obsolescence markers (run 'hg update' to get a working copy) + $ hg debugobsolete | sort + e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob) + f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob) $ hg log -G o 2:b0551702f918 (draft) [tip ] 2 |