record: fix display of non-ASCII names in chunk selection

46cdcb89086f fixed display of non-ASCII names in file-selecting prompt, but
display in chunk selection remained broken. The reason is that using '%r' in
string formatting results in calling `repr` on file names, thus mangling
non-ASCII ones.
This commit is contained in:
Nikolaj Sjujskij 2012-09-15 00:06:08 +04:00
parent a4c03168e1
commit 88edfbe265

View File

@ -393,11 +393,11 @@ the hunk is left unchanged.
if skipfile is None and skipall is None:
chunk.pretty(ui)
if total == 1:
msg = _('record this change to %r?') % chunk.filename()
msg = _("record this change to '%s'?") % chunk.filename()
else:
idx = pos - len(h.hunks) + i
msg = _('record change %d/%d to %r?') % (idx, total,
chunk.filename())
msg = _("record change %d/%d to '%s'?") % (idx, total,
chunk.filename())
r, skipfile, skipall, newpatches = prompt(skipfile,
skipall, msg, chunk)
if r: