[PATCH] ui.prompt(): let overridden write() method do it's job. Fix for color on win32.
Mads Kiilerich
mads at kiilerich.com
Sun Jul 31 15:23:25 CDT 2011
Andrei Vermel wrote, On 07/31/2011 05:55 PM:
> # HG changeset patch
> # Parent b192d1dc6a848d08b757dd0f6fb2f4416acc170f
> # User Andrei Vermel <avermel at mail.ru>
> # Date 1312127463 -14400
>
> ui.prompt(): let overridden write() method do it's job. Fix for color
> on win32.
>
Will this also fix http://mercurial.selenic.com/bts/issue2887 ?
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -540,7 +540,7 @@
> # instead of trying to emulate raw_input, swap our in/out
> # with sys.stdin/out
> old = sys.stdout, sys.stdin
> - sys.stdout, sys.stdin = self.fout, self.fin
> + sys.stdout, sys.stdin = self, self.fin
Wouw. _That_ is duck typing. I don't think the ui class itself was
intended to implement the file protocol, so relying on it might be a bit
fragile.
The patch outlined in http://markmail.org/message/7xpw3r7jgvynbsbq could
perhaps be a better solution, but it seems like the patch and
http://mercurial.selenic.com/bts/issue2590 died there. In my opinion it
would be better to try something like that instead.
/Mads
More information about the Mercurial-devel
mailing list