##// END OF EJS Templates
subrepo: normalize svn output line-endings
Patrick Mezard -
r10197:29e3c4a7 default
parent child Browse files
Show More
@@ -261,7 +261,7 b' class svnsubrepo(object):'
261 cmd = ['svn'] + commands + [self._path]
261 cmd = ['svn'] + commands + [self._path]
262 cmd = [util.shellquote(arg) for arg in cmd]
262 cmd = [util.shellquote(arg) for arg in cmd]
263 cmd = util.quotecommand(' '.join(cmd))
263 cmd = util.quotecommand(' '.join(cmd))
264 write, read, err = util.popen3(cmd)
264 write, read, err = util.popen3(cmd, newlines=True)
265 retdata = read.read()
265 retdata = read.read()
266 err = err.read().strip()
266 err = err.read().strip()
267 if err:
267 if err:
@@ -38,19 +38,23 b' def _fastsha1(s):'
38
38
39 import subprocess
39 import subprocess
40 closefds = os.name == 'posix'
40 closefds = os.name == 'posix'
41 def popen2(cmd):
41
42 def popen2(cmd, newlines=False):
42 # Setting bufsize to -1 lets the system decide the buffer size.
43 # Setting bufsize to -1 lets the system decide the buffer size.
43 # The default for bufsize is 0, meaning unbuffered. This leads to
44 # The default for bufsize is 0, meaning unbuffered. This leads to
44 # poor performance on Mac OS X: http://bugs.python.org/issue4194
45 # poor performance on Mac OS X: http://bugs.python.org/issue4194
45 p = subprocess.Popen(cmd, shell=True, bufsize=-1,
46 p = subprocess.Popen(cmd, shell=True, bufsize=-1,
46 close_fds=closefds,
47 close_fds=closefds,
47 stdin=subprocess.PIPE, stdout=subprocess.PIPE)
48 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
49 universal_newlines=newlines)
48 return p.stdin, p.stdout
50 return p.stdin, p.stdout
49 def popen3(cmd):
51
52 def popen3(cmd, newlines=False):
50 p = subprocess.Popen(cmd, shell=True, bufsize=-1,
53 p = subprocess.Popen(cmd, shell=True, bufsize=-1,
51 close_fds=closefds,
54 close_fds=closefds,
52 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
55 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
53 stderr=subprocess.PIPE)
56 stderr=subprocess.PIPE,
57 universal_newlines=newlines)
54 return p.stdin, p.stdout, p.stderr
58 return p.stdin, p.stdout, p.stderr
55
59
56 def version():
60 def version():
General Comments 0
You need to be logged in to leave comments. Login now