repoview: move '_getdynamicblock' next to 'hideablerevs'
There are the two functions that extensions should use to augment the hidding
logic. It seem better to have them together at the top of the file.
python3: allow hgloader to work with lazy loaders
Don't clobber the loader returned from find_spec.
This brings `hg version` down from 0.27 seconds to 0.17.
init: turn on demandimport for Python 3.6 and above
This uses the new demandimport implementation for Python 3 introduced in
previous patches.
This doesn't yet enhance performance because it isn't integrated with the
custom source file loader we use on Python 3. We'll integrate the two in
upcoming patches.
demandimport: add python 3 implementation
This implementation uses the new importlib finder/loader functionality
available in Python 3.5 and up.
# no-check-commit
demandimport: move ignore list to __init__.py
We're going to use the same ignore list for Python 3.
check: check modules in hgdemandimport
A few places only check modules in mercurial and hgext. Add
hgdemandimport to the list in those places.
demandimport: move to separate package
In Python 3, demand loading is per-package. Keeping demandimport in the
mercurial package would disable demand loading for any modules in
mercurial.
import-checker: add a way to directly import certain symbols
We'll use this for the 'demandimport' symbol in an upcoming patch.
check-code: allow skipping hasattr check in py3-only code
hasattr is safe in Python 3, and in an upcoming patch we can't use
util.safehasattr.
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.