# HG changeset patch # User Pierre-Yves David # Date 1490950925 -7200 # Node ID f610c3220eecf9ee52ae03123adee06c323f9bad # Parent f243b7fbeba5c568868c6475ec63affe5724602a hook: fix name used in untrusted message The name used in the message we issue when a hook is untrusted was using "name" which is actually the hook type and not the name of the hook. diff -r f243b7fbeba5 -r f610c3220eec mercurial/hook.py --- a/mercurial/hook.py Fri Mar 31 10:59:37 2017 +0200 +++ b/mercurial/hook.py Fri Mar 31 11:02:05 2017 +0200 @@ -223,9 +223,9 @@ if cmd is _fromuntrusted: if throw: raise error.HookAbort( - _('untrusted hook %s not executed') % name, + _('untrusted hook %s not executed') % hname, hint = _("see 'hg help config.trusted'")) - ui.warn(_('warning: untrusted hook %s not executed\n') % name) + ui.warn(_('warning: untrusted hook %s not executed\n') % hname) r = 1 raised = False elif callable(cmd): diff -r f243b7fbeba5 -r f610c3220eec tests/test-hook.t --- a/tests/test-hook.t Fri Mar 31 10:59:37 2017 +0200 +++ b/tests/test-hook.t Fri Mar 31 11:02:05 2017 +0200 @@ -904,7 +904,7 @@ > txnclose.testing=echo txnclose hook called > EOF $ touch a && hg commit -Aqm a - warning: untrusted hook txnclose not executed + warning: untrusted hook txnclose.testing not executed $ hg log changeset: 0:3903775176ed tag: tip @@ -923,7 +923,7 @@ $ touch b && hg commit -Aqm a transaction abort! rollback completed - abort: untrusted hook pretxnclose not executed + abort: untrusted hook pretxnclose.testing not executed (see 'hg help config.trusted') [255] $ hg log