Mercurial > evolve
changeset 5671:8c5f2c37b911
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.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Fri, 27 Nov 2020 09:47:01 +0800 |
parents | 777ca21a6f71 |
children | 12c53d7122a7 |
files | CHANGELOG hgext3rd/evolve/__init__.py tests/test-prune.t |
diffstat | 3 files changed, 6 insertions(+), 51 deletions(-) [+] |
line wrap: on
line diff
--- 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 --------------------
--- 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]
--- 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