Patchwork [6,of,8] ui: do not use rawinput() when we have to replace sys.stdin/stdout

login
register
mail settings
Submitter Matt Harbison
Date March 10, 2018, 4:52 a.m.
Message ID <op.zfm85etq9lwrgf@envy>
Download mbox | patch
Permalink /patch/29234/
State New
Headers show

Comments

Matt Harbison - March 10, 2018, 4:52 a.m.
On Fri, 09 Mar 2018 07:35:39 -0500, Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1520325533 21600
> #      Tue Mar 06 02:38:53 2018 -0600
> # Node ID ad7ff97565b261d82952acc9f941e5dd99f11374
> # Parent  63a13b91e1ab4d9fa0a713935be58794b9cadab5
> ui: do not use rawinput() when we have to replace sys.stdin/stdout

Windows really doesn't like this[1].  The simplest example out of that  
might be:

    use 'hg resolve' to retry unresolved file merges or 'hg merge --abort'  
to abandon
    [1]

(I bisected it back to this commit.  The fact that the testbot didn't pick  
up on it when first run is an example of changes not affecting the results  
until the subsequent run.)

[1]  
https://buildbot.mercurial-scm.org/builders/Win7%20x86_64%20hg%20tests/builds/542/steps/run-tests.py%20%28python%202.7.13%29/logs/stdio
Yuya Nishihara - March 10, 2018, 7:02 a.m.
On Fri, 09 Mar 2018 23:52:16 -0500, Matt Harbison wrote:
> On Fri, 09 Mar 2018 07:35:39 -0500, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> > # HG changeset patch
> > # User Yuya Nishihara <yuya@tcha.org>
> > # Date 1520325533 21600
> > #      Tue Mar 06 02:38:53 2018 -0600
> > # Node ID ad7ff97565b261d82952acc9f941e5dd99f11374
> > # Parent  63a13b91e1ab4d9fa0a713935be58794b9cadab5
> > ui: do not use rawinput() when we have to replace sys.stdin/stdout
> 
> Windows really doesn't like this[1].  The simplest example out of that  
> might be:
> 
> --- c:/Users/Matt/projects/hg/tests/test-merge-tools.t
> +++ c:/Users/Matt/projects/hg/tests/test-merge-tools.t.err
> @@ -556,6 +556,9 @@
>     > u
>     > EOF
>     keep (l)ocal [working copy], take (o)ther [merge rev], or leave  
> (u)nresolved for f? u
> +
> +  unrecognized response
> +  keep (l)ocal [working copy], take (o)ther [merge rev], or leave  
> (u)nresolved for f?

Good catch. It appears that the new code is too strict on line ending.

Patch

--- c:/Users/Matt/projects/hg/tests/test-merge-tools.t
+++ c:/Users/Matt/projects/hg/tests/test-merge-tools.t.err
@@ -556,6 +556,9 @@ 
    > u
    > EOF
    keep (l)ocal [working copy], take (o)ther [merge rev], or leave  
(u)nresolved for f? u
+
+  unrecognized response
+  keep (l)ocal [working copy], take (o)ther [merge rev], or leave  
(u)nresolved for f?
    0 files updated, 0 files merged, 0 files removed, 1 files unresolved