Mercurial > public > mercurial-scm > hg-stable
diff mercurial/dispatch.py @ 47759:d7515d29761d stable 5.9rc0
branching: merge default into stable
This mark the start of the 5.9 freeze.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 21 Jul 2021 22:52:09 +0200 |
parents | a2bf93ab3014 |
children | 8fae2cc6ee86 |
line wrap: on
line diff
--- a/mercurial/dispatch.py Fri Jul 09 00:25:14 2021 +0530 +++ b/mercurial/dispatch.py Wed Jul 21 22:52:09 2021 +0200 @@ -1064,6 +1064,16 @@ if req.earlyoptions[b'profile']: for ui_ in uis: ui_.setconfig(b'profiling', b'enabled', b'true', b'--profile') + elif req.earlyoptions[b'profile'] is False: + # Check for it being set already, so that we don't pollute the config + # with this when using chg in the very common case that it's not + # enabled. + if lui.configbool(b'profiling', b'enabled'): + # Only do this on lui so that `chg foo` with a user config setting + # profiling.enabled=1 still shows profiling information (chg will + # specify `--no-profile` when `hg serve` is starting up, we don't + # want that to propagate to every later invocation). + lui.setconfig(b'profiling', b'enabled', b'false', b'--no-profile') profile = lui.configbool(b'profiling', b'enabled') with profiling.profile(lui, enabled=profile) as profiler: