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

Augie Fackler raf at durin42.com
Wed Nov 16 17:39:29 EST 2016


Wait, I missed something semi-obvious: this isn't the full resolved command name, so it's not what I had in mind. I'll send a more complete patch once I get that sorted.

> On Nov 16, 2016, at 17:36, Augie Fackler <raf at durin42.com> wrote:
> 
> # 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,
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list