# HG changeset patch # User Yuya Nishihara # Date 2016-08-13 03:08:23 # Node ID 008d37c4d783a6c22c1d211a8cd0a30e881edd80 # Parent a9c71d578a1cb59dc89b42fbd9a2f8d4ad7894b2 base85: switch to policy importer diff --git a/contrib/check-py3-compat.py b/contrib/check-py3-compat.py --- a/contrib/check-py3-compat.py +++ b/contrib/check-py3-compat.py @@ -17,7 +17,6 @@ import traceback # Modules that have both Python and C implementations. _dualmodules = ( - 'base85.py', 'bdiff.py', 'diffhelpers.py', 'mpatch.py', diff --git a/contrib/import-checker.py b/contrib/import-checker.py --- a/contrib/import-checker.py +++ b/contrib/import-checker.py @@ -26,7 +26,6 @@ allowsymbolimports = ( # Modules that have both Python and C implementations. _dualmodules = ( - 'base85.py', 'bdiff.py', 'diffhelpers.py', 'mpatch.py', diff --git a/contrib/wix/dist.wxs b/contrib/wix/dist.wxs --- a/contrib/wix/dist.wxs +++ b/contrib/wix/dist.wxs @@ -12,7 +12,7 @@ - + diff --git a/mercurial/__init__.py b/mercurial/__init__.py --- a/mercurial/__init__.py +++ b/mercurial/__init__.py @@ -23,7 +23,6 @@ modulepolicy = policy.policy # Modules that have both Python and C implementations. See also the # set of .py files under mercurial/pure/. _dualmodules = { - 'mercurial.base85', 'mercurial.bdiff', 'mercurial.diffhelpers', 'mercurial.mpatch', diff --git a/mercurial/base85.c b/mercurial/cext/base85.c rename from mercurial/base85.c rename to mercurial/cext/base85.c diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -1026,11 +1026,11 @@ def debuginstall(ui, **opts): err = None try: from . import ( - base85, bdiff, mpatch, ) from .cext import ( + base85, osutil, ) dir(bdiff), dir(mpatch), dir(base85), dir(osutil) # quiet pyflakes diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -42,7 +42,6 @@ import warnings import zlib from . import ( - base85, encoding, error, i18n, @@ -51,6 +50,7 @@ from . import ( pycompat, ) +base85 = policy.importmod(r'base85') osutil = policy.importmod(r'osutil') b85decode = base85.b85decode diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -621,7 +621,7 @@ if sys.platform == 'darwin': osutil_ldflags += ['-framework', 'ApplicationServices'] extmodules = [ - Extension('mercurial.base85', ['mercurial/base85.c'], + Extension('mercurial.cext.base85', ['mercurial/cext/base85.c'], include_dirs=common_include_dirs, depends=common_depends), Extension('mercurial.bdiff', ['mercurial/bdiff.c',