Patchwork D9221: revert: leverage cmdutil.check_incompatible_arguments()

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2020, 6:03 a.m.
Message ID <differential-rev-PHID-DREV-tkax5u5h66yn2sve4c4y-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47479/
State Superseded
Headers show

Comments

phabricator - Oct. 16, 2020, 6:03 a.m.
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/D9221

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -6056,8 +6056,7 @@ 
 
     opts = pycompat.byteskwargs(opts)
     if opts.get(b"date"):
-        if opts.get(b"rev"):
-            raise error.Abort(_(b"you can't specify a revision and a date"))
+        cmdutil.check_incompatible_arguments(opts, b'date', [b'rev'])
         opts[b"rev"] = cmdutil.finddate(ui, repo, opts[b"date"])
 
     parent, p2 = repo.dirstate.parents()