##// END OF EJS Templates
parsers: switch to policy importer...
Yuya Nishihara -
r32372:df448de7 default
parent child Browse files
Show More
@@ -17,7 +17,6 b' import traceback'
17 17
18 18 # Modules that have both Python and C implementations.
19 19 _dualmodules = (
20 'parsers.py',
21 20 )
22 21
23 22 def check_compat_py2(f):
@@ -26,7 +26,6 b' allowsymbolimports = ('
26 26
27 27 # Modules that have both Python and C implementations.
28 28 _dualmodules = (
29 'parsers.py',
30 29 )
31 30
32 31 # Modules that must be aliased because they are commonly confused with
@@ -17,7 +17,7 b''
17 17 <File Name="mercurial.cext.diffhelpers.pyd" />
18 18 <File Name="mercurial.cext.mpatch.pyd" />
19 19 <File Name="mercurial.cext.osutil.pyd" />
20 <File Name="mercurial.parsers.pyd" />
20 <File Name="mercurial.cext.parsers.pyd" />
21 21 <File Name="pyexpat.pyd" />
22 22 <File Name="bz2.pyd" />
23 23 <File Name="select.pyd" />
@@ -23,7 +23,6 b' modulepolicy = policy.policy'
23 23 # Modules that have both Python and C implementations. See also the
24 24 # set of .py files under mercurial/pure/.
25 25 _dualmodules = {
26 'mercurial.parsers',
27 26 }
28 27
29 28 class hgimporter(object):
1 NO CONTENT: file renamed from mercurial/dirs.c to mercurial/cext/dirs.c
1 NO CONTENT: file renamed from mercurial/manifest.c to mercurial/cext/manifest.c
1 NO CONTENT: file renamed from mercurial/parsers.c to mercurial/cext/parsers.c
1 NO CONTENT: file renamed from mercurial/pathencode.c to mercurial/cext/pathencode.c
@@ -19,14 +19,16 b' from . import ('
19 19 encoding,
20 20 error,
21 21 match as matchmod,
22 parsers,
23 22 pathutil,
23 policy,
24 24 pycompat,
25 25 scmutil,
26 26 txnutil,
27 27 util,
28 28 )
29 29
30 parsers = policy.importmod(r'parsers')
31
30 32 propertycache = util.propertycache
31 33 filecache = scmutil.filecache
32 34 _rangemask = 0x7fffffff
@@ -14,6 +14,7 b' import unicodedata'
14 14
15 15 from . import (
16 16 error,
17 policy,
17 18 pycompat,
18 19 )
19 20
@@ -318,7 +319,7 b' def _asciilower(s):'
318 319 def asciilower(s):
319 320 # delay importing avoids cyclic dependency around "parsers" in
320 321 # pure Python build (util => i18n => encoding => parsers => util)
321 from . import parsers
322 parsers = policy.importmod(r'parsers')
322 323 impl = getattr(parsers, 'asciilower', _asciilower)
323 324 global asciilower
324 325 asciilower = impl
@@ -334,7 +335,7 b' def _asciiupper(s):'
334 335 def asciiupper(s):
335 336 # delay importing avoids cyclic dependency around "parsers" in
336 337 # pure Python build (util => i18n => encoding => parsers => util)
337 from . import parsers
338 parsers = policy.importmod(r'parsers')
338 339 impl = getattr(parsers, 'asciiupper', _asciiupper)
339 340 global asciiupper
340 341 asciiupper = impl
@@ -19,11 +19,12 b' from .node import ('
19 19 from . import (
20 20 error,
21 21 mdiff,
22 parsers,
22 policy,
23 23 revlog,
24 24 util,
25 25 )
26 26
27 parsers = policy.importmod(r'parsers')
27 28 propertycache = util.propertycache
28 29
29 30 def _parsev1(data):
@@ -76,11 +76,13 b' from .i18n import _'
76 76 from . import (
77 77 error,
78 78 node,
79 parsers,
80 79 phases,
80 policy,
81 81 util,
82 82 )
83 83
84 parsers = policy.importmod(r'parsers')
85
84 86 _pack = struct.pack
85 87 _unpack = struct.unpack
86 88 _calcsize = struct.calcsize
@@ -10,8 +10,8 b' from __future__ import absolute_import'
10 10 import struct
11 11 import zlib
12 12
13 from .node import nullid
14 from . import pycompat
13 from ..node import nullid
14 from .. import pycompat
15 15 stringio = pycompat.stringio
16 16
17 17
@@ -32,12 +32,14 b' from . import ('
32 32 ancestor,
33 33 error,
34 34 mdiff,
35 parsers,
35 policy,
36 36 pycompat,
37 37 templatefilters,
38 38 util,
39 39 )
40 40
41 parsers = policy.importmod(r'parsers')
42
41 43 _pack = struct.pack
42 44 _unpack = struct.unpack
43 45 # Aliased for performance.
@@ -15,12 +15,14 b' import stat'
15 15 from .i18n import _
16 16 from . import (
17 17 error,
18 parsers,
18 policy,
19 19 pycompat,
20 20 util,
21 21 vfs as vfsmod,
22 22 )
23 23
24 parsers = policy.importmod(r'parsers')
25
24 26 # This avoids a collision between a file named foo and a dir named
25 27 # foo.i or foo.d
26 28 def _encodedir(path):
@@ -45,13 +45,13 b' from . import ('
45 45 encoding,
46 46 error,
47 47 i18n,
48 parsers,
49 48 policy,
50 49 pycompat,
51 50 )
52 51
53 52 base85 = policy.importmod(r'base85')
54 53 osutil = policy.importmod(r'osutil')
54 parsers = policy.importmod(r'parsers')
55 55
56 56 b85decode = base85.b85decode
57 57 b85encode = base85.b85encode
@@ -635,10 +635,10 b' extmodules = ['
635 635 'mercurial/cext/mpatch.c'],
636 636 include_dirs=common_include_dirs,
637 637 depends=common_depends),
638 Extension('mercurial.parsers', ['mercurial/dirs.c',
639 'mercurial/manifest.c',
640 'mercurial/parsers.c',
641 'mercurial/pathencode.c'],
638 Extension('mercurial.cext.parsers', ['mercurial/cext/dirs.c',
639 'mercurial/cext/manifest.c',
640 'mercurial/cext/parsers.c',
641 'mercurial/cext/pathencode.c'],
642 642 include_dirs=common_include_dirs,
643 643 depends=common_depends),
644 644 Extension('mercurial.cext.osutil', ['mercurial/cext/osutil.c'],
@@ -11,10 +11,12 b' from mercurial import ('
11 11 context,
12 12 dirstate,
13 13 extensions,
14 parsers,
14 policy,
15 15 util,
16 16 )
17 17
18 parsers = policy.importmod(r'parsers')
19
18 20 def pack_dirstate(fakenow, orig, dmap, copymap, pl, now):
19 21 # execute what original parsers.pack_dirstate should do actually
20 22 # for consistency
@@ -14,9 +14,11 b' from mercurial.node import ('
14 14 nullrev,
15 15 )
16 16 from mercurial import (
17 parsers,
17 policy,
18 18 )
19 19
20 parsers = policy.importmod(r'parsers')
21
20 22 # original python implementation
21 23 def gettype(q):
22 24 return int(q & 0xFFFF)
@@ -114,7 +116,7 b' def importparsers(hexversion):'
114 116 # of the currently-running Python interpreter, so we monkey-patch
115 117 # sys.hexversion to simulate using different versions.
116 118 code = ("import sys; sys.hexversion=%s; "
117 "import mercurial.parsers" % hexversion)
119 "import mercurial.cext.parsers" % hexversion)
118 120 cmd = "python -c \"%s\"" % code
119 121 # We need to do these tests inside a subprocess because parser.c's
120 122 # version-checking code happens inside the module init function, and
General Comments 0
You need to be logged in to leave comments. Login now