Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
32628:5732e6d2b369 | 32629:71eb6a098315 |
---|---|
1209 o 1:e016b03fd86f (draft) [ ] 1 | 1209 o 1:e016b03fd86f (draft) [ ] 1 |
1210 | | 1210 | |
1211 o 0:a78f55e5508c (draft) [ ] 0 | 1211 o 0:a78f55e5508c (draft) [ ] 0 |
1212 | 1212 |
1213 | 1213 |
1214 $ hg strip --hidden -r 2 --config extensions.strip= --config devel.strip-obsmarkers=no | |
1215 saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e008cf283490-39c978dc-backup.hg (glob) | |
1216 $ hg debugobsolete | |
1217 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob) | |
1218 f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob) | |
1219 $ hg log -G | |
1220 @ 2:b0551702f918 (draft) [tip ] 2 | |
1221 | | |
1222 o 1:e016b03fd86f (draft) [ ] 1 | |
1223 | | |
1224 o 0:a78f55e5508c (draft) [ ] 0 | |
1225 | |
1226 $ hg log -G --hidden | |
1227 @ 2:b0551702f918 (draft) [tip ] 2 | |
1228 | | |
1229 o 1:e016b03fd86f (draft) [ ] 1 | |
1230 | | |
1231 o 0:a78f55e5508c (draft) [ ] 0 | |
1232 | |
1233 $ hg debugbundle .hg/strip-backup/e008cf283490-*-backup.hg | |
1234 Stream params: sortdict([('Compression', 'BZ')]) | |
1235 changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])" | |
1236 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 | |
1237 f27abbcc1f77fb409cf9160482fe619541e2d605 | |
1238 obsmarkers -- 'sortdict()' | |
1239 version: 1 (70 bytes) | |
1240 f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
1241 | |
1242 $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg | |
1243 pulling from .hg/strip-backup/e008cf283490-39c978dc-backup.hg | |
1244 searching for changes | |
1245 no changes found | |
1246 $ hg debugobsolete | |
1247 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob) | |
1248 f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob) | |
1249 $ hg log -G | |
1250 @ 2:b0551702f918 (draft) [tip ] 2 | |
1251 | | |
1252 o 1:e016b03fd86f (draft) [ ] 1 | |
1253 | | |
1254 o 0:a78f55e5508c (draft) [ ] 0 | |
1255 | |
1256 $ hg log -G --hidden | |
1257 @ 2:b0551702f918 (draft) [tip ] 2 | |
1258 | | |
1259 o 1:e016b03fd86f (draft) [ ] 1 | |
1260 | | |
1261 o 0:a78f55e5508c (draft) [ ] 0 | |
1262 | |
1263 | |
1264 Testing that strip remove markers: | |
1265 | |
1214 $ hg strip -r 1 --config extensions.strip= | 1266 $ hg strip -r 1 --config extensions.strip= |
1215 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | 1267 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
1216 saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg (glob) | 1268 saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-65ede734-backup.hg (glob) |
1269 $ hg debugobsolete | |
1217 $ hg log -G | 1270 $ hg log -G |
1218 @ 0:a78f55e5508c (draft) [tip ] 0 | 1271 @ 0:a78f55e5508c (draft) [tip ] 0 |
1219 | 1272 |
1220 $ hg log -G --hidden | 1273 $ hg log -G --hidden |
1221 @ 0:a78f55e5508c (draft) [tip ] 0 | 1274 @ 0:a78f55e5508c (draft) [tip ] 0 |
1222 | 1275 |
1223 $ hg debugbundle .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg | 1276 $ hg debugbundle .hg/strip-backup/e016b03fd86f-*-backup.hg |
1224 Stream params: sortdict([('Compression', 'BZ')]) | 1277 Stream params: sortdict([('Compression', 'BZ')]) |
1225 changegroup -- "sortdict([('version', '02'), ('nbchanges', '4')])" | 1278 changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])" |
1226 e016b03fd86fcccc54817d120b90b751aaf367d6 | 1279 e016b03fd86fcccc54817d120b90b751aaf367d6 |
1227 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 | |
1228 f27abbcc1f77fb409cf9160482fe619541e2d605 | |
1229 b0551702f918510f01ae838ab03a463054c67b46 | 1280 b0551702f918510f01ae838ab03a463054c67b46 |
1230 obsmarkers -- 'sortdict()' | 1281 obsmarkers -- 'sortdict()' |
1231 version: 1 (139 bytes) | 1282 version: 1 (139 bytes) |
1232 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | 1283 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
1233 f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | 1284 f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
1234 | 1285 |
1235 $ hg pull .hg/strip-backup/* | 1286 $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg |
1236 pulling from .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg | |
1237 searching for changes | |
1238 adding changesets | 1287 adding changesets |
1239 adding manifests | 1288 adding manifests |
1240 adding file changes | 1289 adding file changes |
1241 added 2 changesets with 2 changes to 2 files | 1290 added 2 changesets with 2 changes to 2 files |
1291 2 new obsolescence markers | |
1242 (run 'hg update' to get a working copy) | 1292 (run 'hg update' to get a working copy) |
1293 $ hg debugobsolete | sort | |
1294 e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob) | |
1295 f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob) | |
1243 $ hg log -G | 1296 $ hg log -G |
1244 o 2:b0551702f918 (draft) [tip ] 2 | 1297 o 2:b0551702f918 (draft) [tip ] 2 |
1245 | | 1298 | |
1246 o 1:e016b03fd86f (draft) [ ] 1 | 1299 o 1:e016b03fd86f (draft) [ ] 1 |
1247 | | 1300 | |