comparison mercurial/commands.py @ 38649:0d0f8bd692c4

grep: reject --diff --all-files This combination doesn't make any sense since --diff is the flag to search change history, whereas --all-files is to include unmodified contents. Differential Revision: https://phab.mercurial-scm.org/D3916
author Yuya Nishihara <yuya@tcha.org>
date Wed, 11 Jul 2018 21:23:18 +0900
parents ffd08ec22955
children eba69ddd4e52
comparison
equal deleted inserted replaced
38648:ffd08ec22955 38649:0d0f8bd692c4
2531 2531
2532 Returns 0 if a match is found, 1 otherwise. 2532 Returns 0 if a match is found, 1 otherwise.
2533 """ 2533 """
2534 opts = pycompat.byteskwargs(opts) 2534 opts = pycompat.byteskwargs(opts)
2535 diff = opts.get('all') or opts.get('diff') 2535 diff = opts.get('all') or opts.get('diff')
2536 if diff and opts.get('all_files'):
2537 raise error.Abort(_('--diff and --all-files are mutually exclusive'))
2538
2536 reflags = re.M 2539 reflags = re.M
2537 if opts.get('ignore_case'): 2540 if opts.get('ignore_case'):
2538 reflags |= re.I 2541 reflags |= re.I
2539 try: 2542 try:
2540 regexp = util.re.compile(pattern, reflags) 2543 regexp = util.re.compile(pattern, reflags)