D4820: logtoprocess: sends the canonical command name to the subprocess
yuja (Yuya Nishihara)
phabricator at mercurial-scm.org
Thu Oct 18 09:17:01 EDT 2018
yuja added a comment.
> - a/hgext/logtoprocess.py +++ b/hgext/logtoprocess.py @@ -40,6 +40,9 @@ import sys
>
> from mercurial import ( + dispatch, + encoding, + extensions,
Unused.
> @@ -110,6 +113,12 @@
>
> script = self.config('logtoprocess', event)
> if script:
> if msg:
>
> +
> + # extract the canonical command from the passed opts
> + canonical_command = opts.pop("canonical_command", None)
> + if canonical_command is None:
> + canonical_command = ""
> +
>
> 1. try to format the log message given the remaining
> 2. arguments try: @@ -134,7 +143,8 @@ for key, value in opts.iteritems()) env = dict(itertools.chain(procutil.shellenviron().items(), msgpairs, optpairs),
> - EVENT=event, HGPID=str(os.getpid())) + EVENT=event, HGPID=str(os.getpid()), + LTP_COMMAND=canonical_command)
As I said before, `LTP_*` doesn't sound great. Can't we simply pass in
`canonical_command` as `OPT_CANONICAL_COMMAND`? If we really want to name
it other than `OPT_*`, please document it.
And I noticed there's no test. Can you add some?
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D4820
To: lothiraldan, #hg-reviewers
Cc: yuja, mercurial-devel
More information about the Mercurial-devel
mailing list