[PATCH] ui: add brief comment why raw_input() needs dummy ' ' prompt string
Augie Fackler
raf at durin42.com
Tue Aug 26 14:17:23 CDT 2014
On Sun, Aug 24, 2014 at 01:57:41PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1408851353 -32400
> # Sun Aug 24 12:35:53 2014 +0900
> # Node ID 6eec2f3116ab5ab02fe3b6ed026e34df265ffdb8
> # Parent 90cf454edd709c616d1e5ea4f30fb4d02f0c01a4
> ui: add brief comment why raw_input() needs dummy ' ' prompt string
Queued, thanks
>
> Retrieved from 17ffb30d9174.
>
> I was about to move ' ' to label(msg + ' ', 'ui.prompt') so that subclass can
> distinguish prompt output from data. But it was not that simple.
>
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -626,6 +626,8 @@ class ui(object):
> oldout = sys.stdout
> sys.stdin = self.fin
> sys.stdout = self.fout
> + # prompt ' ' must exist; otherwise readline may delete entire line
> + # - http://bugs.python.org/issue12833
> line = raw_input(' ')
> sys.stdin = oldin
> sys.stdout = oldout
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list