Mercurial > public > mercurial-scm > hg-stable
diff mercurial/extensions.py @ 32455:f40dc6f7c12f
profiling: allow loading profiling extension before everything else
6d642ecf1a89 makes profiler start early without loading extensions. That
makes it impossible for an extension to add customized profilers.
This patch adds a special case: if a profiler is not found but an extension
with the same name could be loaded, load that extension first, and expect it
to have a "profile" contextmanager method. This allows customized profilers
and extension setup time is still profiled.
author | Jun Wu <quark@fb.com> |
---|---|
date | Mon, 22 May 2017 01:17:49 -0700 |
parents | 9a3e88d4a030 |
children | de09138bf0f5 |
line wrap: on
line diff
--- a/mercurial/extensions.py Mon May 22 00:51:56 2017 -0700 +++ b/mercurial/extensions.py Mon May 22 01:17:49 2017 -0700 @@ -181,7 +181,7 @@ def loadall(ui, whitelist=None): result = ui.configitems("extensions") - if whitelist: + if whitelist is not None: result = [(k, v) for (k, v) in result if k in whitelist] newindex = len(_order) for (name, path) in result: