# HG changeset patch # User Anton Shestakov # Date 1606441621 -28800 # Node ID 8c5f2c37b911388dcb85f3f67d6a2963fccaf4a5 # Parent 777ca21a6f71069328f7c3edf42adc07af01973a strip: remove experimental.prunestrip option marmoute decided to drop it because it's "neither documented nor a good idea". This extensions was assemble to deal with Facebook willingness to check `hg strip` semantic for its user. Changing `hg strip` semantic is overall a pretty bad idea, because `stripping` is a specific operation, that is problematic in distributed version control but have a narrow set of valid usecase (eg: maintenance). Diverting user away from `prune` in favor of a modified `strip` is a bad idea, because it mask the legitimate `strip` usage and introduce confusion in user heads, The verb is not appropriate and the behavior of `prunestrip` does not match the one of vanillia `strip`. Facebook is no longer using this, and the lack of documentation is a good hint that nobody else is. So lets drop it. diff -r 777ca21a6f71 -r 8c5f2c37b911 CHANGELOG --- a/CHANGELOG Thu Nov 26 07:40:10 2020 +0100 +++ b/CHANGELOG Fri Nov 27 09:47:01 2020 +0800 @@ -1,6 +1,11 @@ Changelog ========= +10.2.0 - in progress +-------------------- + + * strip: remove experimental.prunestrip option + 10.1.0 -- 2020-10-31 -------------------- diff -r 777ca21a6f71 -r 8c5f2c37b911 hgext3rd/evolve/__init__.py --- a/hgext3rd/evolve/__init__.py Thu Nov 26 07:40:10 2020 +0100 +++ b/hgext3rd/evolve/__init__.py Fri Nov 27 09:47:01 2020 +0800 @@ -270,7 +270,6 @@ node, pycompat, revset, - scmutil, ) from mercurial.i18n import _ @@ -350,7 +349,6 @@ # Configuration eh.configitem(b'experimental', b'evolutioncommands', []) eh.configitem(b'experimental', b'evolution.allnewcommands', None) -eh.configitem(b'experimental', b'prunestrip', False) ##################################################################### ### Option configuration ### @@ -1179,41 +1177,6 @@ finally: lockmod.release(tr, lock, wlock) -try: - from mercurial import strip - strip - stripcmd = b'debugstrip' - stripext = None -except ImportError: - # hg <= 5.6 (d7a508a75d72) - stripcmd = b'strip' - stripext = b'strip' - -@eh.wrapcommand(stripcmd, extension=stripext, opts=[ - (b'', b'bundle', None, _(b"delete the commit entirely and move it to a " - b"backup bundle")), - ]) -def stripwrapper(orig, ui, repo, *revs, **kwargs): - if (not ui.configbool(b'experimental', b'prunestrip') - or kwargs.get('bundle', False)): - return orig(ui, repo, *revs, **kwargs) - - if kwargs.get('force'): - ui.warn(_(b"warning: --force has no effect during strip with evolve " - b"enabled\n")) - if kwargs.get('no_backup', False): - ui.warn(_(b"warning: --no-backup has no effect during strips with " - b"evolve enabled\n")) - - revs = list(revs) + kwargs.pop('rev', []) - revs = set(scmutil.revrange(repo, revs)) - revs = repo.revs(b"(%ld)::", revs) - kwargs['rev'] = [] - kwargs['new'] = [] - kwargs['successor'] = [] - kwargs['biject'] = False - return cmdrewrite.cmdprune(ui, repo, *revs, **kwargs) - @eh.extsetup def oldevolveextsetup(ui): entry = cmdutil.findcmd(b'commit', commands.table)[1] diff -r 777ca21a6f71 -r 8c5f2c37b911 tests/test-prune.t --- a/tests/test-prune.t Thu Nov 26 07:40:10 2020 +0100 +++ b/tests/test-prune.t Fri Nov 27 09:47:01 2020 +0800 @@ -257,25 +257,12 @@ 14:21b6f2f1cece[] (obsolete/draft) add n2 12:6e8148413dd5[prune-pair-book] (draft) add nE -test hg strip replacement - +test hg prune --keep $ hg up 10 0 files updated, 0 files merged, 2 files removed, 0 files unresolved (leaving bookmark prune-pair-book) $ mkcommit n1 created new head - $ mkcommit n2 - $ hg --config experimental.prunestrip=True debugstrip -r . - 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - working directory is now at c7e58696a948 - 1 changesets pruned - $ hg --config experimental.prunestrip=True debugstrip -r . --bundle - 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - saved backup bundle to $TESTTMP/repo/.hg/strip-backup/c7e58696a948-69ca36d3-backup.hg (glob) - -test hg prune --keep - $ mkcommit n1 - created new head $ hg diff -r .^ diff -r aa96dc3f04c2 n1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000