diff -r bfcd5c7cbf9a -r aabc01da9834 mercurial/commands.py --- a/mercurial/commands.py Wed Jul 11 22:06:04 2018 +0900 +++ b/mercurial/commands.py Tue Jul 10 22:55:30 2018 +0900 @@ -2538,7 +2538,8 @@ if opts.get('all_files') is None and not opts.get('rev') and not diff: # experimental config: commands.grep.all-files opts['all_files'] = ui.configbool('commands', 'grep.all-files') - if opts.get('all_files') and not opts.get('rev'): + plaingrep = opts.get('all_files') and not opts.get('rev') + if plaingrep: opts['rev'] = ['wdir()'] reflags = re.M @@ -2648,7 +2649,7 @@ cols = [ ('filename', fn, True), - ('rev', rev, True), + ('rev', rev, not plaingrep), ('linenumber', l.linenum, opts.get('line_number')), ] if diff: