Patchwork D9220: incoming: 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-psaqune7beby2m6d5ckj-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47481/
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/D9220

AFFECTED FILES
  mercurial/commands.py
  tests/test-subrepo-recursion.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t
--- a/tests/test-subrepo-recursion.t
+++ b/tests/test-subrepo-recursion.t
@@ -681,7 +681,7 @@ 
   no changes found
 
   $ hg incoming -S --bundle incoming.hg
-  abort: cannot combine --bundle and --subrepos
+  abort: cannot specify both --subrepos and --bundle
   [255]
 
 Test missing subrepo:
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4226,8 +4226,7 @@ 
         hg._incoming(display, lambda: 1, ui, repo, source, opts, buffered=True)
         return 0
 
-    if opts.get(b'bundle') and opts.get(b'subrepos'):
-        raise error.Abort(_(b'cannot combine --bundle and --subrepos'))
+    cmdutil.check_incompatible_arguments(opts, b'subrepos', [b'bundle'])
 
     if opts.get(b'bookmarks'):
         source, branches = hg.parseurl(