sshpeer: add implementation of _calltwowaystream
This implements the call needed by bundle2. The error handling is a bit flaky
right now, but bundle2 error handling in general is still flaky anyway. Bundle2
is still disabled by default, I do not expect this to be a problem.
--- a/mercurial/sshpeer.py Tue Apr 15 17:19:46 2014 -0400
+++ b/mercurial/sshpeer.py Tue Apr 15 17:18:35 2014 -0400
@@ -179,6 +179,18 @@
return '', r
return self._recv(), ''
+ def _calltwowaystream(self, cmd, fp, **args):
+ r = self._call(cmd, **args)
+ if r:
+ # XXX needs to be made better
+ raise util.Abort('unexpected remote reply: %s' % r)
+ while True:
+ d = fp.read(4096)
+ if not d:
+ break
+ self._send(d)
+ self._send("", flush=True)
+ return self.pipei
def _recv(self):
l = self.pipei.readline()