[PATCH 3 of 3 v2] dispatch: make hg --profile wrap reposetup

Yuya Nishihara yuya at tcha.org
Tue Sep 20 09:01:28 EDT 2016


On Mon, 19 Sep 2016 16:13:58 -0700, Arun Kulshreshtha wrote:
> # HG changeset patch
> # User Arun Kulshreshtha <kulshrax at fb.com>
> # Date 1474318006 25200
> #      Mon Sep 19 13:46:46 2016 -0700
> # Node ID 20af15cac045b249aece42cb71b671302b6c314c
> # Parent  6f33cc84cdd6c9ab38d32784505b6fb53bf3eba9
> dispatch: make hg --profile wrap reposetup
> 
> Add profiling to _dispatch so that reposetup is included in the profiler
> output. All existing usage of the profiling context manager has been preserved,
> so the existing behavior of profiling enabled after reposetup will not be
> affected.
> 
> diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
> --- a/mercurial/dispatch.py
> +++ b/mercurial/dispatch.py
> @@ -844,7 +844,7 @@
>      elif not cmd:
>          return commands.help_(ui, 'shortlist')
>  
> -    if True:
> +    with profiling.maybeprofile(ui):
>          repo = None
>          cmdpats = args[:]
>          if not _cmdattr(ui, cmd, func, 'norepo'):

Any reason to not remove maybeprofile() from _runcommand() ? Can it be enabled
after reposetup() ?


More information about the Mercurial-devel mailing list