comparison mercurial/util.py @ 9084:9f191931c859

Merge backed out change
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 08 Jul 2009 17:03:16 -0700
parents 9b8c9266c59d ec171737aaf1
children 4858f2cacb4d 8ec39725d966
comparison
equal deleted inserted replaced
9044:d4d4da54ab05 9084:9f191931c859
36 _fastsha1 = sha1 = _sha1 36 _fastsha1 = sha1 = _sha1
37 return _sha1(s) 37 return _sha1(s)
38 38
39 import subprocess 39 import subprocess
40 closefds = os.name == 'posix' 40 closefds = os.name == 'posix'
41 def popen2(cmd): 41 def popen2(cmd, bufsize=-1):
42 p = subprocess.Popen(cmd, shell=True, close_fds=closefds, 42 p = subprocess.Popen(cmd, shell=True, bufsize=bufsize,
43 close_fds=closefds,
43 stdin=subprocess.PIPE, stdout=subprocess.PIPE) 44 stdin=subprocess.PIPE, stdout=subprocess.PIPE)
44 return p.stdin, p.stdout 45 return p.stdin, p.stdout
45 def popen3(cmd): 46 def popen3(cmd, bufsize=-1):
46 p = subprocess.Popen(cmd, shell=True, close_fds=closefds, 47 p = subprocess.Popen(cmd, shell=True, bufsize=bufsize,
48 close_fds=closefds,
47 stdin=subprocess.PIPE, stdout=subprocess.PIPE, 49 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
48 stderr=subprocess.PIPE) 50 stderr=subprocess.PIPE)
49 return p.stdin, p.stdout, p.stderr 51 return p.stdin, p.stdout, p.stderr
50 52
51 def version(): 53 def version():