Patchwork [3,of,3] dispatch: make hg --profile wrap reposetup

login
register
mail settings
Submitter Arun Kulshreshtha
Date Sept. 19, 2016, 8:53 p.m.
Message ID <5f50f386e97814080dc7.1474318380@dev10559.prn2.facebook.com>
Download mbox | patch
Permalink /patch/16674/
State Superseded
Headers show

Comments

Arun Kulshreshtha - Sept. 19, 2016, 8:53 p.m.
# HG changeset patch
# User Arun Kulshreshtha <kulshrax@fb.com>
# Date 1474318006 25200
#      Mon Sep 19 13:46:46 2016 -0700
# Node ID 5f50f386e97814080dc7542af9b30aa77aba0115
# Parent  2ffa94402289c595f16e7732d28399adeb251657
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.
Sean Farley - Sept. 19, 2016, 10:18 p.m.
Arun Kulshreshtha <kulshrax@fb.com> writes:

> # HG changeset patch
> # User Arun Kulshreshtha <kulshrax@fb.com>
> # Date 1474318006 25200
> #      Mon Sep 19 13:46:46 2016 -0700
> # Node ID 5f50f386e97814080dc7542af9b30aa77aba0115
> # Parent  2ffa94402289c595f16e7732d28399adeb251657
> 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.

These patches seem pretty straight-forward, surprisingly. Maybe Greg
should take a look, too.

Patch

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