##// END OF EJS Templates
narrow: add --no-backup option for narrowing...
Martin von Zweigbergk -
r47206:3c360ab2 default
parent child Browse files
Show More
@@ -214,6 +214,7 b' def _narrow('
214 214 newincludes,
215 215 newexcludes,
216 216 force,
217 backup,
217 218 ):
218 219 oldmatch = narrowspec.match(repo.root, oldincludes, oldexcludes)
219 220 newmatch = narrowspec.match(repo.root, newincludes, newexcludes)
@@ -272,7 +273,7 b' def _narrow('
272 273 hg.clean(repo, urev)
273 274 overrides = {(b'devel', b'strip-obsmarkers'): False}
274 275 with ui.configoverride(overrides, b'narrow'):
275 repair.strip(ui, unfi, tostrip, topic=b'narrow')
276 repair.strip(ui, unfi, tostrip, topic=b'narrow', backup=backup)
276 277
277 278 todelete = []
278 279 for f, f2, size in repo.store.datafiles():
@@ -442,6 +443,12 b' def _widen('
442 443 ),
443 444 (
444 445 b'',
446 b'backup',
447 True,
448 _(b'back up local changes when narrowing'),
449 ),
450 (
451 b'',
445 452 b'update-working-copy',
446 453 False,
447 454 _(b'update working copy when the store has changed'),
@@ -639,6 +646,7 b' def trackedcmd(ui, repo, remotepath=None'
639 646 newincludes,
640 647 newexcludes,
641 648 opts[b'force_delete_local_changes'],
649 opts[b'backup'],
642 650 )
643 651 # _narrow() updated the narrowspec and _widen() below needs to
644 652 # use the updated values as its base (otherwise removed includes
@@ -110,6 +110,8 b' Testing the --import-rules flag of `hg t'
110 110 --clear whether to replace the existing narrowspec
111 111 --force-delete-local-changes forces deletion of local changes when
112 112 narrowing
113 --[no-]backup back up local changes when narrowing
114 (default: on)
113 115 --update-working-copy update working copy when the store has
114 116 changed
115 117 -e --ssh CMD specify ssh command to use
@@ -492,3 +492,20 b' Test --auto-remove-includes'
492 492 searching for changes
493 493 looking for unused includes to remove
494 494 found no unused includes
495 Test --no-backup
496 $ hg tracked --addinclude d0 --addinclude d2 -q
497 $ hg unbundle .hg/strip-backup/*-narrow.hg -q
498 $ rm .hg/strip-backup/*
499 $ hg tracked --auto-remove-includes --no-backup
500 comparing with ssh://user@dummy/master
501 searching for changes
502 looking for unused includes to remove
503 path:d0
504 path:d2
505 remove these unused includes (yn)? y
506 looking for local changes to affected paths
507 deleting data/d0/f.i
508 deleting data/d2/f.i
509 deleting meta/d0/00manifest.i (tree !)
510 deleting meta/d2/00manifest.i (tree !)
511 $ ls .hg/strip-backup/
General Comments 0
You need to be logged in to leave comments. Login now