[Updated] D9219: grep: levarage cmdutil.check_incompatible_arguments()

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Oct 16 07:50:30 UTC 2020


Closed by commit rHG4f7309fdfb60: grep: levarage cmdutil.check_incompatible_arguments() (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D9219?vs=23237&id=23251

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D9219/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D9219

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3365,11 +3365,10 @@
     Returns 0 if a match is found, 1 otherwise.
 
     """
+    cmdutil.check_incompatible_arguments(opts, 'all_files', ['all', 'diff'])
     opts = pycompat.byteskwargs(opts)
     diff = opts.get(b'all') or opts.get(b'diff')
     follow = opts.get(b'follow')
-    if diff and opts.get(b'all_files'):
-        raise error.Abort(_(b'--diff and --all-files are mutually exclusive'))
     if opts.get(b'all_files') is None and not diff:
         opts[b'all_files'] = True
     plaingrep = (



To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20201016/d661825b/attachment-0002.html>


More information about the Mercurial-patches mailing list