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

Nikolaj Sjujskij sterkrig at myopera.com
Fri Sep 14 16:25:58 CDT 2012


# HG changeset patch
# User Nikolaj Sjujskij <sterkrig at myopera.com>
# Date 1347653168 -14400
# Node ID 328d1d810c5bdb96b9b008047799822da6b4ff21
# Parent  fc1a5d0eb3bbb1116051b65dcd2873389f9d7ed4
record: fix display of non-ASCII names in chunk selection

b013baa3898e 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.

diff --git a/hgext/record.py b/hgext/record.py
--- a/hgext/record.py
+++ b/hgext/record.py
@@ -393,11 +393,11 @@
             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:


More information about the Mercurial-devel mailing list