diff hgdemandimport/__init__.py @ 32458:0906b85bf222

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.
author Siddharth Agarwal <sid0@fb.com>
date Sun, 21 May 2017 12:10:53 -0700
parents
children f37f9499fea8
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hgdemandimport/__init__.py	Sun May 21 12:10:53 2017 -0700
@@ -0,0 +1,23 @@
+# hgdemandimport - global demand-loading of modules for Mercurial
+#
+# Copyright 2017 Facebook Inc.
+#
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+'''demandimport - automatic demand-loading of modules'''
+
+# This is in a separate package from mercurial because in Python 3,
+# demand loading is per-package. Keeping demandimport in the mercurial package
+# would disable demand loading for any modules in mercurial.
+
+from __future__ import absolute_import
+
+from . import demandimportpy2 as demandimport
+
+# Re-export.
+ignore = demandimport.ignore
+isenabled = demandimport.isenabled
+enable = demandimport.enable
+disable = demandimport.disable
+deactivated = demandimport.deactivated