Show More
@@ -0,0 +1,23 b'' | |||
|
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 b' allowsymbolimports = (' | |||
|
25 | 25 | ) |
|
26 | 26 | |
|
27 | 27 | # Whitelist of symbols that can be directly imported. |
|
28 |
directsymbols = ( |
|
|
28 | directsymbols = ( | |
|
29 | 'demandimport', | |
|
30 | ) | |
|
29 | 31 | |
|
30 | 32 | # Modules that must be aliased because they are commonly confused with |
|
31 | 33 | # common variables and can create aliasing and readability issues. |
|
1 | NO CONTENT: file renamed from mercurial/demandimport.py to hgdemandimport/demandimportpy2.py |
@@ -9,6 +9,10 b' from __future__ import absolute_import' | |||
|
9 | 9 | |
|
10 | 10 | import sys |
|
11 | 11 | |
|
12 | # Allow 'from mercurial import demandimport' to keep working. | |
|
13 | import hgdemandimport | |
|
14 | demandimport = hgdemandimport | |
|
15 | ||
|
12 | 16 | __all__ = [] |
|
13 | 17 | |
|
14 | 18 | # Python 3 uses a custom module loader that transforms source code between |
@@ -587,7 +587,8 b" packages = ['mercurial'," | |||
|
587 | 587 | 'mercurial.pure', |
|
588 | 588 | 'hgext', 'hgext.convert', 'hgext.fsmonitor', |
|
589 | 589 | 'hgext.fsmonitor.pywatchman', 'hgext.highlight', |
|
590 |
'hgext.largefiles', 'hgext.zeroconf', 'hgext3rd' |
|
|
590 | 'hgext.largefiles', 'hgext.zeroconf', 'hgext3rd', | |
|
591 | 'hgdemandimport'] | |
|
591 | 592 | |
|
592 | 593 | common_depends = ['mercurial/bitmanipulation.h', |
|
593 | 594 | 'mercurial/compat.h', |
@@ -793,7 +794,7 b" setup(name='mercurial'," | |||
|
793 | 794 | package_data=packagedata, |
|
794 | 795 | cmdclass=cmdclass, |
|
795 | 796 | distclass=hgdist, |
|
796 | options={'py2exe': {'packages': ['hgext', 'email']}, | |
|
797 | options={'py2exe': {'packages': ['hgdemandimport', 'hgext', 'email']}, | |
|
797 | 798 | 'bdist_mpkg': {'zipdist': False, |
|
798 | 799 | 'license': 'COPYING', |
|
799 | 800 | 'readme': 'contrib/macosx/Readme.html', |
General Comments 0
You need to be logged in to leave comments.
Login now