# HG changeset patch # User Martin von Zweigbergk # Date 2020-10-16 05:23:35 # Node ID 4f7309fdfb60e8bfdd5bc400ac6b954157c06862 # Parent d1cabce5ef0528d254b46ffc45827ea5cd752da3 grep: levarage cmdutil.check_incompatible_arguments() Differential Revision: https://phab.mercurial-scm.org/D9219 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3365,11 +3365,10 @@ def grep(ui, repo, pattern, *pats, **opt 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 = (