[PATCH 4 of 8] encode all output in stdio encoding

Andrey grooz-work at gorodok.net
Mon Nov 20 13:01:34 CST 2006


On 21 November 2006 (Tue) 00:34, Alexis S. L. Carvalho wrote:
> Thus spake Alexis S. L. Carvalho:
> > Thus spake Andrey:
> > > I should better have written something like 'encode all output in stdio
> > > encoding, if not already encoded' in commit message. :) That
> > > ui.ui.encode() function leaves all non-Unicode strings untouched, so hg
> > > cat works as expected.
> >
> > It prints a traceback with hg log --patch with a revision that changes
> > the encoding of a file.
>
> Hmm...  ok, it doesn't even get to ui.write - the current log code puts
> all strings in a list and does a ui.write("".join(strings)).  This
> patchset changes some of these strings from str's to unicode's, and so
> the "".join() raises an exception when it fails to convert the patch to
> a unicode.

I think we just have to explicitly encode log message here with 'stdin' 
encoding (although I'm not completely sure).

Andrey


More information about the Mercurial-devel mailing list