##// END OF EJS Templates
procutil: add a shim for translating shell commands to native commands
Matt Harbison -
r38510:72286f9e default
parent child Browse files
Show More
@@ -139,9 +139,7 b' def _exthook(ui, repo, htype, name, cmd,'
139 139 v = stringutil.pprint(v)
140 140 env['HG_' + k.upper()] = v
141 141
142 if pycompat.iswindows:
143 environ = procutil.shellenviron(env)
144 cmd = util.platform.shelltocmdexe(cmd, environ)
142 cmd = procutil.shelltonative(cmd, env)
145 143
146 144 ui.note(_("running hook %s: %s\n") % (name, cmd))
147 145
@@ -317,6 +317,13 b' def shellenviron(environ=None):'
317 317 env['HG'] = hgexecutable()
318 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 327 def system(cmd, environ=None, cwd=None, out=None):
321 328 '''enhanced shell command execution.
322 329 run with environment maybe modified, maybe in different dir.
General Comments 0
You need to be logged in to leave comments. Login now