##// END OF EJS Templates
grep: search working directory files by default if --all-files is specified...
Yuya Nishihara -
r38672:eba69ddd default
parent child Browse files
Show More
@@ -2535,6 +2535,8 b' def grep(ui, repo, pattern, *pats, **opt'
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'):
2536 if diff and opts.get('all_files'):
2537 raise error.Abort(_('--diff and --all-files are mutually exclusive'))
2537 raise error.Abort(_('--diff and --all-files are mutually exclusive'))
2538 if opts.get('all_files') and not opts.get('rev'):
2539 opts['rev'] = ['wdir()']
2538
2540
2539 reflags = re.M
2541 reflags = re.M
2540 if opts.get('ignore_case'):
2542 if opts.get('ignore_case'):
@@ -412,6 +412,18 b' Test for showing working of allfiles fla'
412 $ hg grep -r "." "unmod" --all-files
412 $ hg grep -r "." "unmod" --all-files
413 um:1:unmod
413 um:1:unmod
414
414
415 With --all-files, the working directory is searched by default
416
417 $ echo modified >> new
418 $ hg grep --all-files mod
419 new:2147483647:modified
420 um:2147483647:unmod
421
422 which can be overridden by -rREV
423
424 $ hg grep --all-files -r. mod
425 um:1:unmod
426
415 --diff --all-files makes no sense since --diff is the option to grep history
427 --diff --all-files makes no sense since --diff is the option to grep history
416
428
417 $ hg grep --diff --all-files um
429 $ hg grep --diff --all-files um
General Comments 0
You need to be logged in to leave comments. Login now