tracing: trace command function execution
authorBoris Feld <boris.feld@octobus.net>
Thu, 06 Sep 2018 16:59:25 -0400
changeset 39512 ec0a2601bc76
parent 39511 1ab185c78cc3
child 39513 e9706686451b
tracing: trace command function execution Differential Revision: https://phab.mercurial-scm.org/D4514
mercurial/dispatch.py
--- a/mercurial/dispatch.py	Fri Sep 07 16:51:51 2018 -0400
+++ b/mercurial/dispatch.py	Thu Sep 06 16:59:25 2018 -0400
@@ -992,7 +992,8 @@
 def _runcommand(ui, options, cmd, cmdfunc):
     """Run a command function, possibly with profiling enabled."""
     try:
-        return cmdfunc()
+        with tracing.log("Running %s command" % cmd):
+            return cmdfunc()
     except error.SignatureError:
         raise error.CommandError(cmd, _('invalid arguments'))