On Wed, 19 Apr 2017 15:22:42 -0400, Augie Fackler <r...@durin42.com> wrote:

On Sat, Apr 15, 2017 at 1:04 PM, Augie Fackler <r...@durin42.com> wrote:

On Apr 15, 2017, at 5:48 AM, Yuya Nishihara <y...@tcha.org> wrote:

On Thu, 13 Apr 2017 16:17:34 -0400, Augie Fackler wrote:
# HG changeset patch
# User Augie Fackler <au...@google.com>
# Date 1492114180 14400
#      Thu Apr 13 16:09:40 2017 -0400
# Node ID ec81fd7580f3e31aa92e8834ffbcf2a8e80e72e3
# Parent  35afb54dbb4df2975dbbf0e1525b98611f18ba85
sshpeer: try harder to snag stderr when stdout closes unexpectedly

Resolves test failures on FreeBSD, but I'm not happy about the fix.

diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
--- a/mercurial/sshpeer.py
+++ b/mercurial/sshpeer.py
@@ -110,9 +110,17 @@ class doublepipe(object):
            if mainready:
                meth = getattr(self._main, methname)
                if data is None:
-                    return meth()
+                    r = meth()
                else:
-                    return meth(data)
+                    r = meth(data)
+                if not r and data != 0:

I'm not sure what this condition is intended for. It's always true for
write() because r is None and data is a str.

This forwarder is also used for read(), where data is the number of bytes to be read. At least, I think that’s right, now I’m doubting myself.

Should I go ahead and mail this patch? Perhaps with some extra
comments? Or do people object to this fix?

+1. We picked up another instance of this issue in the last few days, that this patch also fixes:

--- c:/Users/Matt/Projects/hg/tests/test-ssh-bundle1.t
+++ c:/Users/Matt/Projects/hg/tests/test-ssh-bundle1.t.err
@@ -555,8 +555,8 @@
   pulling from ssh://user@dummy/remote
   searching for changes
   adding changesets
-  remote: abort: this is an exercise
   transaction abort!
   rollback completed
   abort: stream ended unexpectedly (got 0 bytes, expected 4)
-  [255]
+  remote: abort: this is an exercise
+  [255]
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to