[PATCH 6 of 6 V2] parsers: add version to help detect breaking binary changes

Jun Wu quark at fb.com
Fri May 19 11:46:13 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1493167410 25200
#      Tue Apr 25 17:43:30 2017 -0700
# Node ID 67f77153a5d7091f4ce5ff665fd32bd0080f6b1f
# Parent  358a98a28d54b4c7c193e4f631641243d7f55dc7
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 67f77153a5d7
parsers: add version to help detect breaking binary changes

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -2855,6 +2855,10 @@ void dirs_module_init(PyObject *mod);
 void manifest_module_init(PyObject *mod);
 
+static const int version = 1;
+
 static void module_init(PyObject *mod)
 {
+	PyModule_AddIntConstant(mod, "version", version);
+
 	/* This module constant has two purposes.  First, it lets us unit test
 	 * the ImportError raised without hard-coding any error text.  This


More information about the Mercurial-devel mailing list