##// END OF EJS Templates
demandimport: move to separate package...
Siddharth Agarwal -
r32420:0906b85b default
parent child Browse files
Show More
@@ -0,0 +1,23
1 # hgdemandimport - global demand-loading of modules for Mercurial
2 #
3 # Copyright 2017 Facebook Inc.
4 #
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
7
8 '''demandimport - automatic demand-loading of modules'''
9
10 # This is in a separate package from mercurial because in Python 3,
11 # demand loading is per-package. Keeping demandimport in the mercurial package
12 # would disable demand loading for any modules in mercurial.
13
14 from __future__ import absolute_import
15
16 from . import demandimportpy2 as demandimport
17
18 # Re-export.
19 ignore = demandimport.ignore
20 isenabled = demandimport.isenabled
21 enable = demandimport.enable
22 disable = demandimport.disable
23 deactivated = demandimport.deactivated
@@ -25,7 +25,9 allowsymbolimports = (
25 )
25 )
26
26
27 # Whitelist of symbols that can be directly imported.
27 # Whitelist of symbols that can be directly imported.
28 directsymbols = ()
28 directsymbols = (
29 'demandimport',
30 )
29
31
30 # Modules that must be aliased because they are commonly confused with
32 # Modules that must be aliased because they are commonly confused with
31 # common variables and can create aliasing and readability issues.
33 # common variables and can create aliasing and readability issues.
1 NO CONTENT: file renamed from mercurial/demandimport.py to hgdemandimport/demandimportpy2.py
NO CONTENT: file renamed from mercurial/demandimport.py to hgdemandimport/demandimportpy2.py
@@ -9,6 +9,10 from __future__ import absolute_import
9
9
10 import sys
10 import sys
11
11
12 # Allow 'from mercurial import demandimport' to keep working.
13 import hgdemandimport
14 demandimport = hgdemandimport
15
12 __all__ = []
16 __all__ = []
13
17
14 # Python 3 uses a custom module loader that transforms source code between
18 # Python 3 uses a custom module loader that transforms source code between
@@ -587,7 +587,8 packages = ['mercurial',
587 'mercurial.pure',
587 'mercurial.pure',
588 'hgext', 'hgext.convert', 'hgext.fsmonitor',
588 'hgext', 'hgext.convert', 'hgext.fsmonitor',
589 'hgext.fsmonitor.pywatchman', 'hgext.highlight',
589 'hgext.fsmonitor.pywatchman', 'hgext.highlight',
590 'hgext.largefiles', 'hgext.zeroconf', 'hgext3rd']
590 'hgext.largefiles', 'hgext.zeroconf', 'hgext3rd',
591 'hgdemandimport']
591
592
592 common_depends = ['mercurial/bitmanipulation.h',
593 common_depends = ['mercurial/bitmanipulation.h',
593 'mercurial/compat.h',
594 'mercurial/compat.h',
@@ -793,7 +794,7 setup(name='mercurial',
793 package_data=packagedata,
794 package_data=packagedata,
794 cmdclass=cmdclass,
795 cmdclass=cmdclass,
795 distclass=hgdist,
796 distclass=hgdist,
796 options={'py2exe': {'packages': ['hgext', 'email']},
797 options={'py2exe': {'packages': ['hgdemandimport', 'hgext', 'email']},
797 'bdist_mpkg': {'zipdist': False,
798 'bdist_mpkg': {'zipdist': False,
798 'license': 'COPYING',
799 'license': 'COPYING',
799 'readme': 'contrib/macosx/Readme.html',
800 'readme': 'contrib/macosx/Readme.html',
General Comments 0
You need to be logged in to leave comments. Login now