Mercurial > public > mercurial-scm > hg
diff hgdemandimport/__init__.py @ 33860:3cfc9070245f
demandimport: disable if chg is being used
In chg's case, making modules lazily loaded could actually slow down things
since chg pre-imports them. Therefore disable demandimport if chg is being
used.
This is not done by setting `HGDEMANDIMPORT` chg client-side because that
has side-effects on child processes (hooks, etc).
Differential Revision: https://phab.mercurial-scm.org/D351
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 16 Aug 2017 10:44:06 -0700 |
parents | 8fb5212652ec |
children | 670eb4fa1b86 |
line wrap: on
line diff
--- a/hgdemandimport/__init__.py Fri Aug 18 11:08:17 2017 -0700 +++ b/hgdemandimport/__init__.py Wed Aug 16 10:44:06 2017 -0700 @@ -73,5 +73,7 @@ deactivated = demandimport.deactivated def enable(): - if os.environ.get('HGDEMANDIMPORT') != 'disable': + # chg pre-imports modules so do not enable demandimport for it + if ('CHGINTERNALMARK' not in os.environ + and os.environ.get('HGDEMANDIMPORT') != 'disable'): demandimport.enable()