parsers: add version to help detect breaking binary changes
authorJun Wu <quark@fb.com>
Tue, 25 Apr 2017 17:43:30 -0700
changeset 32360 af3ef002395d
parent 32359 dc51700be00c
child 32361 124ee239d9cb
parsers: add version to help detect breaking binary changes
mercurial/parsers.c
--- a/mercurial/parsers.c	Tue Apr 25 17:36:59 2017 -0700
+++ b/mercurial/parsers.c	Tue Apr 25 17:43:30 2017 -0700
@@ -2854,8 +2854,12 @@
 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
 	 * means we can change the text in the future without breaking tests,