mercurial/commands.py
changeset 38653 aabc01da9834
parent 38652 bfcd5c7cbf9a
child 38783 e7aa113b14f7
equal deleted inserted replaced
38652:bfcd5c7cbf9a 38653:aabc01da9834
  2536         raise error.Abort(_('--diff and --all-files are mutually exclusive'))
  2536         raise error.Abort(_('--diff and --all-files are mutually exclusive'))
  2537     # TODO: remove "not opts.get('rev')" if --all-files -rMULTIREV gets working
  2537     # TODO: remove "not opts.get('rev')" if --all-files -rMULTIREV gets working
  2538     if opts.get('all_files') is None and not opts.get('rev') and not diff:
  2538     if opts.get('all_files') is None and not opts.get('rev') and not diff:
  2539         # experimental config: commands.grep.all-files
  2539         # experimental config: commands.grep.all-files
  2540         opts['all_files'] = ui.configbool('commands', 'grep.all-files')
  2540         opts['all_files'] = ui.configbool('commands', 'grep.all-files')
  2541     if opts.get('all_files') and not opts.get('rev'):
  2541     plaingrep = opts.get('all_files') and not opts.get('rev')
       
  2542     if plaingrep:
  2542         opts['rev'] = ['wdir()']
  2543         opts['rev'] = ['wdir()']
  2543 
  2544 
  2544     reflags = re.M
  2545     reflags = re.M
  2545     if opts.get('ignore_case'):
  2546     if opts.get('ignore_case'):
  2546         reflags |= re.I
  2547         reflags |= re.I
  2646             fm.context(ctx=ctx)
  2647             fm.context(ctx=ctx)
  2647             fm.data(node=fm.hexfunc(scmutil.binnode(ctx)))
  2648             fm.data(node=fm.hexfunc(scmutil.binnode(ctx)))
  2648 
  2649 
  2649             cols = [
  2650             cols = [
  2650                 ('filename', fn, True),
  2651                 ('filename', fn, True),
  2651                 ('rev', rev, True),
  2652                 ('rev', rev, not plaingrep),
  2652                 ('linenumber', l.linenum, opts.get('line_number')),
  2653                 ('linenumber', l.linenum, opts.get('line_number')),
  2653             ]
  2654             ]
  2654             if diff:
  2655             if diff:
  2655                 cols.append(('change', change, True))
  2656                 cols.append(('change', change, True))
  2656             cols.extend([
  2657             cols.extend([