mercurial/cmdutil.py
changeset 33499 0407a51b9d8c
parent 33438 8056481caa81
child 33509 a3acacbd0ff3
equal deleted inserted replaced
33498:b7a75b9a3386 33499:0407a51b9d8c
   206     *operation* is used for to build ui messages to indicate the user what
   206     *operation* is used for to build ui messages to indicate the user what
   207     kind of filtering they are doing: reverting, committing, shelving, etc.
   207     kind of filtering they are doing: reverting, committing, shelving, etc.
   208     (see patch.filterpatch).
   208     (see patch.filterpatch).
   209     """
   209     """
   210     usecurses = crecordmod.checkcurses(ui)
   210     usecurses = crecordmod.checkcurses(ui)
   211     testfile = ui.config('experimental', 'crecordtest', None)
   211     testfile = ui.config('experimental', 'crecordtest')
   212     oldwrite = setupwrapcolorwrite(ui)
   212     oldwrite = setupwrapcolorwrite(ui)
   213     try:
   213     try:
   214         newchunks, newopts = filterchunks(ui, originalhunks, usecurses,
   214         newchunks, newopts = filterchunks(ui, originalhunks, usecurses,
   215                                           testfile, operation)
   215                                           testfile, operation)
   216     finally:
   216     finally:
  1685     if not tmpl and not style: # template are stronger than style
  1685     if not tmpl and not style: # template are stronger than style
  1686         tmpl = ui.config('ui', 'logtemplate')
  1686         tmpl = ui.config('ui', 'logtemplate')
  1687         if tmpl:
  1687         if tmpl:
  1688             return logtemplatespec(templater.unquotestring(tmpl), None)
  1688             return logtemplatespec(templater.unquotestring(tmpl), None)
  1689         else:
  1689         else:
  1690             style = util.expandpath(ui.config('ui', 'style', ''))
  1690             style = util.expandpath(ui.config('ui', 'style'))
  1691 
  1691 
  1692     if not tmpl and style:
  1692     if not tmpl and style:
  1693         mapfile = style
  1693         mapfile = style
  1694         if not os.path.split(mapfile)[0]:
  1694         if not os.path.split(mapfile)[0]:
  1695             mapname = (templater.templatepath('map-cmdline.' + mapfile)
  1695             mapname = (templater.templatepath('map-cmdline.' + mapfile)
  3404         operation = 'discard'
  3404         operation = 'discard'
  3405         reversehunks = True
  3405         reversehunks = True
  3406         if node != parent:
  3406         if node != parent:
  3407             operation = 'revert'
  3407             operation = 'revert'
  3408             reversehunks = repo.ui.configbool('experimental',
  3408             reversehunks = repo.ui.configbool('experimental',
  3409                                               'revertalternateinteractivemode',
  3409                 'revertalternateinteractivemode')
  3410                                               True)
       
  3411         if reversehunks:
  3410         if reversehunks:
  3412             diff = patch.diff(repo, ctx.node(), None, m, opts=diffopts)
  3411             diff = patch.diff(repo, ctx.node(), None, m, opts=diffopts)
  3413         else:
  3412         else:
  3414             diff = patch.diff(repo, None, ctx.node(), m, opts=diffopts)
  3413             diff = patch.diff(repo, None, ctx.node(), m, opts=diffopts)
  3415         originalchunks = patch.parsepatch(diff)
  3414         originalchunks = patch.parsepatch(diff)