[PATCH] policy: define C module versions individually

Jun Wu quark at fb.com
Tue May 23 06:29:11 UTC 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# 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:


More information about the Mercurial-devel mailing list