[PATCH 2 of 4] sshpeer: allow write operations through double pipe

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Jun 5 13:19:14 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1432137509 18000
#      Wed May 20 10:58:29 2015 -0500
# Node ID b47406fc7d16c72606a95712a8e84c47848874ac
# Parent  f3b870f69c3a131e6bf4f54fb58dcb4ac91b290e
sshpeer: allow write operations through double pipe

We have a shiny toy, lets make it wider.

diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
--- a/mercurial/sshpeer.py
+++ b/mercurial/sshpeer.py
@@ -73,10 +73,13 @@ class doublepipe(object):
         except NotImplementedError:
             # non supported yet case, assume all have data.
             act = fds
         return (self._main.fileno() in act, self._side.fileno() in act)
 
+    def write(self, data):
+        return self._call('write', data)
+
     def read(self, size):
         return self._call('read', size)
 
     def readline(self):
         return self._call('readline')
@@ -100,10 +103,13 @@ class doublepipe(object):
                     return meth(data)
 
     def close(self):
         return self._main.close()
 
+    def flush(self):
+        return self._main.flush()
+
 class sshpeer(wireproto.wirepeer):
     def __init__(self, ui, path, create=False):
         self._url = path
         self.ui = ui
         self.pipeo = self.pipei = self.pipee = None


More information about the Mercurial-devel mailing list