comparison mercurial/cmdutil.py @ 29283:14eee72c8d52

revert: use "discard"/"revert" verb when reverting interactively (issue5143) Instead of "record this change to 'FILE'?" now prompt with: * "discard this change to 'FILE'?" when reverting to the parent of working directory, and, * "revert this change to 'FILE'?" otherwise.
author Denis Laxalde <denis.laxalde@logilab.fr>
date Fri, 03 Jun 2016 15:55:07 +0200
parents ead25aa27a43
children d48fc6f318a3
comparison
equal deleted inserted replaced
29282:89822d7a9d5f 29283:14eee72c8d52
3299 if reversehunks: 3299 if reversehunks:
3300 diff = patch.diff(repo, ctx.node(), None, m, opts=diffopts) 3300 diff = patch.diff(repo, ctx.node(), None, m, opts=diffopts)
3301 else: 3301 else:
3302 diff = patch.diff(repo, None, ctx.node(), m, opts=diffopts) 3302 diff = patch.diff(repo, None, ctx.node(), m, opts=diffopts)
3303 originalchunks = patch.parsepatch(diff) 3303 originalchunks = patch.parsepatch(diff)
3304 operation = _('discard') if node == parent else _('revert')
3304 3305
3305 try: 3306 try:
3306 3307
3307 chunks, opts = recordfilter(repo.ui, originalchunks) 3308 chunks, opts = recordfilter(repo.ui, originalchunks,
3309 operation=operation)
3308 if reversehunks: 3310 if reversehunks:
3309 chunks = patch.reversehunks(chunks) 3311 chunks = patch.reversehunks(chunks)
3310 3312
3311 except patch.PatchError as err: 3313 except patch.PatchError as err:
3312 raise error.Abort(_('error parsing patch: %s') % err) 3314 raise error.Abort(_('error parsing patch: %s') % err)