Mercurial > hg
comparison mercurial/hook.py @ 38491: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 | e9e61fbac787 |
children | 539f9708b980 |
comparison
equal
deleted
inserted
replaced
38490:5d88fd1bc2af | 38491:72286f9e324f |
---|---|
137 v = v() | 137 v = v() |
138 if isinstance(v, (dict, list)): | 138 if isinstance(v, (dict, list)): |
139 v = stringutil.pprint(v) | 139 v = stringutil.pprint(v) |
140 env['HG_' + k.upper()] = v | 140 env['HG_' + k.upper()] = v |
141 | 141 |
142 if pycompat.iswindows: | 142 cmd = procutil.shelltonative(cmd, env) |
143 environ = procutil.shellenviron(env) | |
144 cmd = util.platform.shelltocmdexe(cmd, environ) | |
145 | 143 |
146 ui.note(_("running hook %s: %s\n") % (name, cmd)) | 144 ui.note(_("running hook %s: %s\n") % (name, cmd)) |
147 | 145 |
148 if repo: | 146 if repo: |
149 cwd = repo.root | 147 cwd = repo.root |