Mercurial > public > mercurial-scm > hg
diff hgdemandimport/__init__.py @ 33859:8fb5212652ec
demandimport: move HGDEMANDIMPORT test to __init__.py
The logic is now shared between demandimport{2,3}.
Differential Revision: https://phab.mercurial-scm.org/D445
author | Jun Wu <quark@fb.com> |
---|---|
date | Fri, 18 Aug 2017 11:08:17 -0700 |
parents | 859496bb6db3 |
children | 3cfc9070245f |
line wrap: on
line diff
--- a/hgdemandimport/__init__.py Tue Aug 15 10:15:31 2017 -0700 +++ b/hgdemandimport/__init__.py Fri Aug 18 11:08:17 2017 -0700 @@ -13,6 +13,7 @@ from __future__ import absolute_import +import os import sys if sys.version_info[0] >= 3: @@ -68,6 +69,9 @@ # Re-export. isenabled = demandimport.isenabled -enable = demandimport.enable disable = demandimport.disable deactivated = demandimport.deactivated + +def enable(): + if os.environ.get('HGDEMANDIMPORT') != 'disable': + demandimport.enable()