[PATCH STABLE] record: display filename in local encoding when asking about file inclusion

Nikolaj Sjujskij sterkrig at myopera.com
Sat Jun 30 02:37:31 CDT 2012


Den 2012-06-30 07:24:03 skrev Matt Mackall <mpm at selenic.com>:

> On Fri, 2012-06-29 at 22:15 -0500, Matt Mackall wrote:
>> On Sat, 2012-06-30 at 00:43 +0400, Nikolaj Sjujskij wrote:
>> > # HG changeset patch
>> > # User Nikolaj Sjujskij <sterkrig at myopera.com>
>> > # Date 1341002447 -14400
>> > # Node ID 023ecef662bba83047243678a56fa3c4d756e75f
>> > # Parent  1cdd0ebce8dc11983fcc58f1279c8350f8d66b14
>> > record: display filename in local encoding when asking about file  
>> inclusion
> Actually, no, the current code is not correct, because it's using repr()
> which mangles non-ASCII. And that's been in that prompt since day 1. A
> better answer is:
>
> diff -r 2440822446ce hgext/record.py
> --- a/hgext/record.py	Sat Jun 23 19:57:29 2012 +0300
> +++ b/hgext/record.py	Fri Jun 29 22:22:45 2012 -0500
> @@ -380,7 +380,7 @@
>          if skipall is None:
>              h.pretty(ui)
>          msg = (_('examine changes to %s?') %
> -               _(' and ').join(map(repr, h.files())))
> +               _(' and ').join("'%s'" % f for f in h.files()))
>          r, skipfile, skipall, np = prompt(skipfile, skipall, msg, None)
>          if not r:
>              continue
>
> ..which passes tests. Thanks for spotting.
  It's hard not to spot it when record asks if I want to examine <two lines  
of \x..>, hehe.

> .join("'%s'" % f for f in h.files())
  Yup, that was one of variants I've been pondering about after discovering  
test failure. But it seemed to be too simple and I've left it till morning  
(eastern hemisphere here). Thanks for quick reply.

So I understand that you have queued your variant and the problem has been  
fixed?


More information about the Mercurial-devel mailing list