[PATCH] dispatch: include resolved command name when logging command

Augie Fackler raf at durin42.com
Wed Nov 16 22:36:52 UTC 2016


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1479335668 18000
#      Wed Nov 16 17:34:28 2016 -0500
# Node ID 34a175911ad07fc7528540e93c4110f393812748
# Parent  a1beadaa406116c0266c46064a00003be7de7394
dispatch: include resolved command name when logging command

This will be useful for anyone that wants to log the specific command
that was executed without having to parse the joined command line
arguments.

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -899,7 +899,7 @@ def _dispatch(req):
             ui.warn(_("warning: --repository ignored\n"))
 
         msg = ' '.join(' ' in a and repr(a) or a for a in fullargs)
-        ui.log("command", '%s\n', msg)
+        ui.log("command", '%s\n', msg, cmd=cmd)
         d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
         try:
             return runcommand(lui, repo, cmd, fullargs, ui, options, d,


More information about the Mercurial-devel mailing list