diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -96,6 +96,9 @@ def _enabledemandimport(): """enable importing on demand to reduce startup time""" + if 'CHGINTERNALMARK' in pycompat.environ: + # disable demandimport for chgserver + return if sys.version_info[0] < 3 or sys.version_info >= (3, 6): import hgdemandimport; hgdemandimport.enable()