util: allow to specify buffer size in popen4
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 20 May 2015 11:29:45 -0500
changeset 25245 504ef9c49f4a
parent 25244 cf90764f40a4
child 25247 f2b98dacb37d
util: allow to specify buffer size in popen4 We will need unbuffered IO to restore real time output with ssh peer. Changeset ec171737aaf1 seems to indicate playing with this value could be dangerous, but does not indicate why.
mercurial/util.py
--- a/mercurial/util.py	Mon May 18 23:19:11 2015 -0500
+++ b/mercurial/util.py	Wed May 20 11:29:45 2015 -0500
@@ -247,8 +247,8 @@
     stdin, stdout, stderr, p = popen4(cmd, env, newlines)
     return stdin, stdout, stderr
 
-def popen4(cmd, env=None, newlines=False):
-    p = subprocess.Popen(cmd, shell=True, bufsize=-1,
+def popen4(cmd, env=None, newlines=False, bufsize=-1):
+    p = subprocess.Popen(cmd, shell=True, bufsize=bufsize,
                          close_fds=closefds,
                          stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE,