changeset 31743:f610c3220eec

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 31 Mar 2017 11:02:05 +0200
parents f243b7fbeba5
children 5678496659e9
files mercurial/hook.py tests/test-hook.t
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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):
--- 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