hooks: move logging of hook name to after we have found the hook
authorMads Kiilerich <madski@unity3d.com>
Sat, 15 Feb 2014 01:23:12 +0100
changeset 20547 9d9f8ccffead
parent 20546 bf1d91ab1efb
child 20548 5bd6a9fec103
hooks: move logging of hook name to after we have found the hook We do not expect the finding process to take a significant amount of time - it is the execution time of the hook we care about.
mercurial/hook.py
--- a/mercurial/hook.py	Thu Feb 20 02:39:01 2014 +0100
+++ b/mercurial/hook.py	Sat Feb 15 01:23:12 2014 +0100
@@ -19,9 +19,6 @@
     unmodified commands (e.g. mercurial.commands.update) can
     be run as hooks without wrappers to convert return values.'''
 
-    ui.note(_("calling hook %s: %s\n") % (hname, funcname))
-    starttime = time.time()
-
     obj = funcname
     if not util.safehasattr(obj, '__call__'):
         d = funcname.rfind('.')
@@ -75,6 +72,10 @@
             raise util.Abort(_('%s hook is invalid '
                                '("%s" is not callable)') %
                              (hname, funcname))
+
+    ui.note(_("calling hook %s: %s\n") % (hname, funcname))
+    starttime = time.time()
+
     try:
         try:
             # redirect IO descriptors to the ui descriptors so hooks