From patchwork Wed Jul 4 12:04:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D3847: fix: disallow 'hg fix --base --whole' From: phabricator X-Patchwork-Id: 32612 Message-Id: <0a988104e0c2675eb40fba16de5e2cb3@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Wed, 4 Jul 2018 12:04:20 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHG3a2c57dfea60: fix: disallow 'hg fix --base <rev> --whole' (authored by hooper, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3847?vs=9366&id=9431 REVISION DETAIL https://phab.mercurial-scm.org/D3847 AFFECTED FILES hgext/fix.py tests/test-fix.t CHANGE DETAILS To: hooper, #hg-reviewers, durin42 Cc: mercurial-devel diff --git a/tests/test-fix.t b/tests/test-fix.t --- a/tests/test-fix.t +++ b/tests/test-fix.t @@ -178,6 +178,9 @@ abort: no changesets specified (use --rev or --working-dir) [255] + $ hg fix --base 0 --whole --working-dir + abort: --base has no meaning in addition to --whole + [255] Fixing a public revision isn't allowed. It should abort early enough that nothing happens, even to the working directory. diff --git a/hgext/fix.py b/hgext/fix.py --- a/hgext/fix.py +++ b/hgext/fix.py @@ -387,6 +387,8 @@ # The --base flag overrides the usual logic, and we give every revision # exactly the set of baserevs that the user specified. if opts.get('base'): + if opts.get('whole'): + raise error.Abort('--base has no meaning in addition to --whole') baserevs = set(scmutil.revrange(repo, opts.get('base'))) if not baserevs: baserevs = {nullrev}