mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
merge with stable
This commit is contained in:
commit
cd3b55bab4
@ -391,9 +391,7 @@ def system(cmd, environ={}, cwd=None, onerr=None, errprefix=None, out=None):
|
||||
return '1'
|
||||
return str(val)
|
||||
origcmd = cmd
|
||||
if os.name == 'nt' and sys.version_info < (2, 7, 1):
|
||||
# Python versions since 2.7.1 do this extra quoting themselves
|
||||
cmd = '"%s"' % cmd
|
||||
cmd = quotecommand(cmd)
|
||||
env = dict(os.environ)
|
||||
env.update((k, py2shell(v)) for k, v in environ.iteritems())
|
||||
env['HG'] = hgexecutable()
|
||||
|
@ -160,9 +160,10 @@ def shellquote(s):
|
||||
|
||||
def quotecommand(cmd):
|
||||
"""Build a command string suitable for os.popen* calls."""
|
||||
# The extra quotes are needed because popen* runs the command
|
||||
# through the current COMSPEC. cmd.exe suppress enclosing quotes.
|
||||
return '"' + cmd + '"'
|
||||
if sys.version_info < (2, 7, 1):
|
||||
# Python versions since 2.7.1 do this extra quoting themselves
|
||||
return '"' + cmd + '"'
|
||||
return cmd
|
||||
|
||||
def popen(command, mode='r'):
|
||||
# Work around "popen spawned process may not write to stdout
|
||||
|
Loading…
Reference in New Issue
Block a user