# HG changeset patch # User Martin Geisler # Date 2009-07-09 09:59:56 # Node ID 6cf043b1aa144db317beef7a5ecbbc86e7bed820 # Parent 60e88d3211713f3358ef6b9132be47ea63e984ff # Parent 8ec39725d966a4f2dc0bf308d582c26264d85819 merge with crew-stable diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -38,13 +38,16 @@ def _fastsha1(s): 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)