On 9/22/16, 4:21 AM, "Yuya Nishihara" <you...@gmail.com on behalf of 
y...@tcha.org> wrote:

    On Thu, 22 Sep 2016 09:04:40 +0000, Arun Kulshreshtha wrote:
    > On 9/21/16, 8:51 PM, "Yuya Nishihara" <you...@gmail.com on behalf of 
y...@tcha.org> wrote:
    >     Perhaps we can move both maybeprofile() calls to _dispatch() without 
thinking
    >     about how nested profilers behave.
    >     
    >     --- a/mercurial/dispatch.py
    >     +++ b/mercurial/dispatch.py
    >     @@ -774,7 +774,8 @@ def _dispatch(req):
    >          # Check abbreviation/ambiguity of shell alias.
    >          shellaliasfn = _checkshellalias(lui, ui, args)
    >          if shellaliasfn:
    >     -        return shellaliasfn()
    >     +        with profiling.maybeprofile(lui):
    >     +            return shellaliasfn()
    >      
    >          # check for fallback encoding
    >          fallback = lui.config('ui', 'fallbackencoding')
    >     @@ -844,6 +845,10 @@ def _dispatch(req):
    >          elif not cmd:
    >              return commands.help_(ui, 'shortlist')
    >      
    >     +    with profiling.maybeprofile(lui):
    >     +        return _dispatchcommand(...)
    >     +
    >     +def _dispatchcommand(...):
    >          repo = None
    >          cmdpats = args[:]
    >          if not _cmdattr(ui, cmd, func, 'norepo'):
    >     
    > 
    > Yes, in fact this is originally what I had intended to do. However, this 
would mean that it
    > would not be possible to enable profiling from the repo-specific config 
file.
    
    That's why 'lui' is passed to maybeprofile().
    
Ah, I see. OK, I’ll change it then using lui and see if everything works.

_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to