changeset 39512:ec0a2601bc76

tracing: trace command function execution Differential Revision: https://phab.mercurial-scm.org/D4514
author Boris Feld <boris.feld@octobus.net>
date Thu, 06 Sep 2018 16:59:25 -0400
parents 1ab185c78cc3
children e9706686451b
files mercurial/dispatch.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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'))