Patchwork chgserver: backport py3 buffered I/O workarounds from procutil

login
register
mail settings
Submitter Pulkit Goyal
Date Dec. 6, 2020, 10:50 a.m.
Message ID <CAJ-kjL-9zVJxX+MvBqT8WChz50dEuHEDW7L9j9ZNKS3MApC1UQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/47811/
State New
Headers show

Comments

Pulkit Goyal - Dec. 6, 2020, 10:50 a.m.
On Tue, Nov 17, 2020 at 6:35 PM Yuya Nishihara <yuya@tcha.org> wrote:
>
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1605608948 -32400
> #      Tue Nov 17 19:29:08 2020 +0900
> # Node ID 0748354881c942727aef46945d721bc51d213e9d
> # Parent  d68618954adef9c2cbec868c1af0e01f67288cb8
> chgserver: backport py3 buffered I/O workarounds from procutil
>
> I've recently switched to new machine and I found chg's stdout is fully
> buffered.
>
> Even though chg server is a daemon process, it inherits the environment
> where the chg client originally forked the server. This means the server's
> stdout might have been wrapped by LineBufferedWrapper. That's why we need
> to do wrap/unwrap in both ways.
>
> The "if" condition in _restoreio() looks weird, but I'm not willing to
> clean things up because stdio behavior is fundamentally different between
> py2 and py3, and py2 support will be dropped anyway.

After this patch, test-extension.t on py3+chg fails with following output:

Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

--- /tmp/mercurial-ci/tests/test-extension.t
+++ /tmp/mercurial-ci/tests/test-extension.t.err
@@ -209,6 +209,18 @@ 
4) bar uipopulate
5) foo reposetup
5) bar reposetup
+ 4) foo uipopulate
+ 4) bar uipopulate
+ 4) foo uipopulate
+ 4) bar uipopulate
+ 4) foo uipopulate
+ 4) bar uipopulate
+ 4) foo uipopulate
+ 4) bar uipopulate
+ 4) foo uipopulate
+ 4) bar uipopulate
+ 5) foo reposetup
+ 5) bar reposetup
0:c24b9ac61126
_______________________________________________
Mercurial-devel mailing list