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

Andrey grooz-work at gorodok.net
Mon Nov 20 17:48:42 UTC 2006


On 20 November 2006 (Mon) 23:28, Matt Mackall wrote:
> On Mon, Nov 20, 2006 at 05:29:54PM +0700, Andrey wrote:
> > # HG changeset patch
> > # User Andrey <grooz-work at gorodok.net>
> > # Date 1163471414 -21600
> > # Node ID ad1e778d48b8e6ae6a75dd5b1cebf854f9fbc0e4
> > # Parent  2e2cc18a4e6dd837305f247ff5e2046084e77960
> > encode all output in stdio encoding
>
> This is wrong. What should happen if I run:
>
>  hg cat random-encoding.txt
>
> Answer: Exactly the same thing as when I run:
>
>  cat random-encoding.txt
>
> It should not attempt to do any conversion. And it absolutely should
> not throw an exception because it fails to coerce things. It should
> pass the data through exactly as it was given. The same rule applies
> for about a dozen other commands.

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.

Andrey



More information about the Mercurial-devel mailing list