From patchwork Tue May 23 06:29:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: policy: define C module versions individually From: Jun Wu X-Patchwork-Id: 20857 Message-Id: <38a5dabea120ab837ff4.1495520951@x1c> To: Date: Mon, 22 May 2017 23:29:11 -0700 # HG changeset patch # User Jun Wu # Date 1495519180 25200 # Mon May 22 22:59:40 2017 -0700 # Node ID 38a5dabea120ab837ff46484c4752762f4564b39 # Parent 8db2feb04cebc1878c6232dd2650f2c5468d350e # Available At https://bitbucket.org/quark-zju/hg-draft # hg pull https://bitbucket.org/quark-zju/hg-draft -r 38a5dabea120 policy: define C module versions individually This allows us to bump the version for a single module without changing all of them. diff --git a/mercurial/policy.py b/mercurial/policy.py --- a/mercurial/policy.py +++ b/mercurial/policy.py @@ -71,6 +71,16 @@ def _importfrom(pkgname, modname): return fakelocals[modname] +# keep in sync with "version" in C modules +_cextversions = { + r'base85': 1, + r'bdiff': 1, + r'diffhelpers': 1, + r'mpatch': 1, + r'osutil': 1, + r'parsers': 1, +} + def _checkmod(pkgname, modname, mod): - expected = 1 # TODO: maybe defined in table? + expected = _cextversions.get(modname) actual = getattr(mod, r'version', None) if actual != expected: