From patchwork Fri Oct 16 06:03:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D9223: tag: leverage cmdutil.check_incompatible_arguments() From: phabricator X-Patchwork-Id: 47482 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 16 Oct 2020 06:03:37 +0000 martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9223 AFFECTED FILES mercurial/commands.py CHANGE DETAILS To: martinvonz, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -7087,6 +7087,7 @@ Returns 0 on success. """ + cmdutil.check_incompatible_arguments(opts, 'remove', ['rev']) opts = pycompat.byteskwargs(opts) with repo.wlock(), repo.lock(): rev_ = b"." @@ -7099,8 +7100,6 @@ raise error.Abort( _(b'tag names cannot consist entirely of whitespace') ) - if opts.get(b'rev') and opts.get(b'remove'): - raise error.Abort(_(b"--rev and --remove are incompatible")) if opts.get(b'rev'): rev_ = opts[b'rev'] message = opts.get(b'message')