sshpeer: check pipe validity before forwarding output from it
After the previous fix, fileobjectproxy._observedcall() (called when
win32.peekpipe() accesses .fileno) started exploding. With this fix, similar
checks are needed inside debugwireproto(). Since that is hardcoded to not use
os.devnull, IDK if those are worth fixing.
--- a/mercurial/sshpeer.py Sat Mar 10 12:22:08 2018 -0500
+++ b/mercurial/sshpeer.py Sat Mar 10 12:45:10 2018 -0500
@@ -32,10 +32,11 @@
"""display all data currently available on pipe as remote output.
This is non blocking."""
- s = util.readpipe(pipe)
- if s:
- for l in s.splitlines():
- ui.status(_("remote: "), l, '\n')
+ if pipe:
+ s = util.readpipe(pipe)
+ if s:
+ for l in s.splitlines():
+ ui.status(_("remote: "), l, '\n')
class doublepipe(object):
"""Operate a side-channel pipe in addition of a main one