Mercurial > public > mercurial-scm > hg
diff mercurial/util.py @ 10197:29e3c4a7699b
subrepo: normalize svn output line-endings
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 02 Jan 2010 16:03:25 +0100 |
parents | 2770d03ae49f |
children | c2e2a5e6c36b |
line wrap: on
line diff
--- a/mercurial/util.py Sat Jan 02 15:48:05 2010 +0100 +++ b/mercurial/util.py Sat Jan 02 16:03:25 2010 +0100 @@ -38,19 +38,23 @@ import subprocess closefds = os.name == 'posix' -def popen2(cmd): + +def popen2(cmd, newlines=False): # 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) + stdin=subprocess.PIPE, stdout=subprocess.PIPE, + universal_newlines=newlines) return p.stdin, p.stdout -def popen3(cmd): + +def popen3(cmd, newlines=False): p = subprocess.Popen(cmd, shell=True, bufsize=-1, close_fds=closefds, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + stderr=subprocess.PIPE, + universal_newlines=newlines) return p.stdin, p.stdout, p.stderr def version():