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

Augie Fackler raf at durin42.com
Wed Sep 21 13:31:31 EDT 2016


On Tue, Sep 20, 2016 at 01:35:22PM -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 f157d9becfe724d624e0f3328febe58c5694d950
> # Parent  0bb030bb1ce94c5514b671a3900ba207ebb19269
> dispatch: make hg --profile wrap reposetup

This makes sense to me. Queued.

(I shiver a little bit at threadlocals, but what can you do? Sigh.)

>
> 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'):
> _______________________________________________
> 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