comparison mercurial/patch.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 9d38a2061fd8
children d48fc6f318a3
comparison
equal deleted inserted replaced
29282:89822d7a9d5f 29283:14eee72c8d52
1107 continue 1107 continue
1108 for i, chunk in enumerate(h.hunks): 1108 for i, chunk in enumerate(h.hunks):
1109 if skipfile is None and skipall is None: 1109 if skipfile is None and skipall is None:
1110 chunk.pretty(ui) 1110 chunk.pretty(ui)
1111 if total == 1: 1111 if total == 1:
1112 msg = _("record this change to '%s'?") % chunk.filename() 1112 msg = _("%s this change to '%s'?") % (operation,
1113 chunk.filename())
1113 else: 1114 else:
1114 idx = pos - len(h.hunks) + i 1115 idx = pos - len(h.hunks) + i
1115 msg = _("record change %d/%d to '%s'?") % (idx, total, 1116 msg = _("%s change %d/%d to '%s'?") % (operation, idx, total,
1116 chunk.filename()) 1117 chunk.filename())
1117 r, skipfile, skipall, newpatches = prompt(skipfile, 1118 r, skipfile, skipall, newpatches = prompt(skipfile,
1118 skipall, msg, chunk) 1119 skipall, msg, chunk)
1119 if r: 1120 if r:
1120 if fixoffset: 1121 if fixoffset:
1121 chunk = copy.copy(chunk) 1122 chunk = copy.copy(chunk)