Mercurial > hg-stable
comparison mercurial/utils/procutil.py @ 38495:72286f9e324f
procutil: add a shim for translating shell commands to native commands
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 28 Jun 2018 22:23:08 -0400 |
parents | d24ad71ff869 |
children | c153f440682f |
comparison
equal
deleted
inserted
replaced
38494:5d88fd1bc2af | 38495:72286f9e324f |
---|---|
315 if environ: | 315 if environ: |
316 env.update((k, py2shell(v)) for k, v in environ.iteritems()) | 316 env.update((k, py2shell(v)) for k, v in environ.iteritems()) |
317 env['HG'] = hgexecutable() | 317 env['HG'] = hgexecutable() |
318 return env | 318 return env |
319 | 319 |
320 if pycompat.iswindows: | |
321 def shelltonative(cmd, env): | |
322 return platform.shelltocmdexe(cmd, shellenviron(env)) | |
323 else: | |
324 def shelltonative(cmd, env): | |
325 return cmd | |
326 | |
320 def system(cmd, environ=None, cwd=None, out=None): | 327 def system(cmd, environ=None, cwd=None, out=None): |
321 '''enhanced shell command execution. | 328 '''enhanced shell command execution. |
322 run with environment maybe modified, maybe in different dir. | 329 run with environment maybe modified, maybe in different dir. |
323 | 330 |
324 if out is specified, it is assumed to be a file-like object that has a | 331 if out is specified, it is assumed to be a file-like object that has a |