comparison mercurial/hook.py @ 38722:2009d84f245a

hook: disable the shell to native command translation by default There are other things I want to add like ~ expansion and translating single to double quotes for cmd.exe. So off by default is safer. I'm having second thoughts about the name, but I don't have any better ideas.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 15 Jul 2018 23:46:09 -0400
parents 38dfd308fe9d
children f9b2d996ffa5
comparison
equal deleted inserted replaced
38721:dbbe45ae5ad1 38722:2009d84f245a
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 ui.configbool('hooks', 'tonative.%s' % name, pycompat.iswindows): 142 if ui.configbool('hooks', 'tonative.%s' % name, False):
143 ui.note(_('converting hook "%s" to native\n') % name) 143 ui.note(_('converting hook "%s" to native\n') % name)
144 cmd = procutil.shelltonative(cmd, env) 144 cmd = procutil.shelltonative(cmd, env)
145 145
146 ui.note(_("running hook %s: %s\n") % (name, cmd)) 146 ui.note(_("running hook %s: %s\n") % (name, cmd))
147 147