D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-22 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG106adc261492: logtoprocess: sends the canonical command name to the subprocess (authored by lothiraldan, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-22 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 12307. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4820?vs=12298&id=12307 REVISION DETAIL https://phab.mercurial-scm.org/D4820 AFFECTED FILES mercurial/dispatch.py tests/test-logtoprocess.t CHANGE DETAIL

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-22 Thread lothiraldan (Boris Feld)
lothiraldan added a comment. In https://phab.mercurial-scm.org/D4820#77397, @yuja wrote: > > +# extract the canonical command from the passed opts. > > +# we need to pop it up from the opts else the msg will try > > +# bein

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-22 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 12298. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4820?vs=12296&id=12298 REVISION DETAIL https://phab.mercurial-scm.org/D4820 AFFECTED FILES mercurial/dispatch.py tests/test-logtoprocess.t CHANGE DETAIL

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-22 Thread yuja (Yuya Nishihara)
yuja added a comment. > +# extract the canonical command from the passed opts. > +# we need to pop it up from the opts else the msg will try > +# being formatted using the passed opts. Oops, that's probably a bug. IIUC, `**

Re: D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-22 Thread Yuya Nishihara
> +# extract the canonical command from the passed opts. > +# we need to pop it up from the opts else the msg will > try > +# being formatted using the passed opts. Oops, that's probably a bug. IIUC, `**opts` is just ancillary data, and

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-22 Thread lothiraldan (Boris Feld)
lothiraldan added a comment. In https://phab.mercurial-scm.org/D4820#77055, @yuja wrote: > > - a/hgext/logtoprocess.py +++ b/hgext/logtoprocess.py @@ -40,6 +40,9 @@ import sys > > > > from mercurial import ( +dispatch, +encoding, +extensions, > > Unused. > > > @

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-22 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 12296. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4820?vs=12161&id=12296 REVISION DETAIL https://phab.mercurial-scm.org/D4820 AFFECTED FILES hgext/logtoprocess.py mercurial/dispatch.py tests/test-logto

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-18 Thread yuja (Yuya Nishihara)
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

Re: D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-18 Thread Yuya Nishihara
> --- 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: >

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-16 Thread lothiraldan (Boris Feld)
lothiraldan updated this revision to Diff 12161. lothiraldan edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4820?vs=11521&id=12161 REVISION DETAIL https://phab.mercurial-scm.org/D4820 AFFECTED FILES hgext/logtoproc

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-04 Thread yuja (Yuya Nishihara)
yuja added a comment. > I tried to pass it to the `ui.log()` but didn't find a clean way to transfer it from `dispatch._dispatch` to `dispatch.dispatch`. I tried storing it in the ui object but without luck. > > Do you think it would be ok to store it in the `request` object?

Re: D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-04 Thread Yuya Nishihara
> I tried to pass it to the `ui.log()` but didn't find a clean way to > transfer it from `dispatch._dispatch` to `dispatch.dispatch`. I tried storing > it in the ui object but without luck. > > Do you think it would be ok to store it in the `request` object? If that helps, yes. I think us

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-03 Thread lothiraldan (Boris Feld)
lothiraldan added a comment. In https://phab.mercurial-scm.org/D4820#73256, @yuja wrote: > > +def extsetup(): > > +# this is to get the canonical name of the command: "commit", not "ci" > > +def wrapdispatch(orig, *args, **kwargs): > > +encoding.environ.pop("LTP_C

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-03 Thread yuja (Yuya Nishihara)
yuja added a comment. > +def extsetup(): > +# this is to get the canonical name of the command: "commit", not "ci" > +def wrapdispatch(orig, *args, **kwargs): > +encoding.environ.pop("LTP_COMMAND", None) > +return orig(*args, **kwargs) > + > +def wr

Re: D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-03 Thread Yuya Nishihara
> +def extsetup(): > +# this is to get the canonical name of the command: "commit", not "ci" > +def wrapdispatch(orig, *args, **kwargs): > +encoding.environ.pop("LTP_COMMAND", None) > +return orig(*args, **kwargs) > + > +def wrapruncommand(orig, *args, **kwargs): > +

D4820: logtoprocess: sends the canonical command name to the subprocess

2018-10-01 Thread lothiraldan (Boris Feld)
lothiraldan created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY One of the use-case of logtoprocess is to monitor command duration. With the current code, we only get whatever command name the user typed (either abbreviat