# HG changeset patch # User Bryan O'Sullivan # Date 2009-07-09 00:01:18 # Node ID ec171737aaf1c03f39c96eb6dd878c60242d31e5 # Parent fce065538bcf858c00731fd2ca77ba631553fdd9 Backed out changeset fce065538bcf: it caused a 5x performance regression on OS X diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -38,12 +38,14 @@ def _fastsha1(s): import subprocess closefds = os.name == 'posix' -def popen2(cmd): - p = subprocess.Popen(cmd, shell=True, close_fds=closefds, +def popen2(cmd, bufsize=-1): + p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, + close_fds=closefds, stdin=subprocess.PIPE, stdout=subprocess.PIPE) return p.stdin, p.stdout -def popen3(cmd): - p = subprocess.Popen(cmd, shell=True, close_fds=closefds, +def popen3(cmd, bufsize=-1): + p = subprocess.Popen(cmd, shell=True, bufsize=bufsize, + close_fds=closefds, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) return p.stdin, p.stdout, p.stderr