changeset 9090:6cf043b1aa14

merge with crew-stable
author Martin Geisler <mg@lazybytes.net>
date Thu, 09 Jul 2009 11:59:56 +0200
parents 60e88d321171 (current diff) 8ec39725d966 (diff)
children 79a886bcf461
files mercurial/util.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Wed Jul 08 22:08:45 2009 -0400
+++ b/mercurial/util.py	Thu Jul 09 11:59:56 2009 +0200
@@ -38,13 +38,16 @@
 
 import subprocess
 closefds = os.name == 'posix'
-def popen2(cmd, bufsize=-1):
-    p = subprocess.Popen(cmd, shell=True, bufsize=bufsize,
+def popen2(cmd):
+    # Setting bufsize to -1 lets the system decide the buffer size.
+    # The default for bufsize is 0, meaning unbuffered. This leads to
+    # poor performance on Mac OS X: http://bugs.python.org/issue4194
+    p = subprocess.Popen(cmd, shell=True, bufsize=-1,
                          close_fds=closefds,
                          stdin=subprocess.PIPE, stdout=subprocess.PIPE)
     return p.stdin, p.stdout
-def popen3(cmd, bufsize=-1):
-    p = subprocess.Popen(cmd, shell=True, bufsize=bufsize,
+def popen3(cmd):
+    p = subprocess.Popen(cmd, shell=True, bufsize=-1,
                          close_fds=closefds,
                          stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE)