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.
--- 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,