sshpeer: rename 'size' to 'data' in doublepipe
We are about to add 'write' support, the argument will be either an int or a
string.
--- a/mercurial/sshpeer.py Fri Jun 05 14:34:58 2015 -0400
+++ b/mercurial/sshpeer.py Wed May 20 17:40:47 2015 -0500
@@ -81,10 +81,11 @@
def readline(self):
return self._call('readline')
- def _call(self, methname, size=None):
+ def _call(self, methname, data=None):
"""call <methname> on "main", forward output of "side" while blocking
"""
- if size == 0 or self._main.closed:
+ # data can be '' or 0
+ if (data is not None and not data) or self._main.closed:
_forwardoutput(self._ui, self._side)
return ''
while True:
@@ -93,10 +94,10 @@
_forwardoutput(self._ui, self._side)
if mainready:
meth = getattr(self._main, methname)
- if size is None:
+ if data is None:
return meth()
else:
- return meth(size)
+ return meth(data)
def close(self):
return self._main.close()