changeset 32396:2f51f4c535d2

diffhelpers: add version to help detect breaking binary changes
author Jun Wu <quark@fb.com>
date Tue, 25 Apr 2017 17:40:13 -0700
parents 7948adb53e28
children 5fc3459d0493
files mercurial/diffhelpers.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/diffhelpers.c	Tue Apr 25 17:45:48 2017 -0700
+++ b/mercurial/diffhelpers.c	Tue Apr 25 17:40:13 2017 -0700
@@ -164,6 +164,8 @@
 	{NULL, NULL}
 };
 
+static const int version = 1;
+
 #ifdef IS_PY3K
 static struct PyModuleDef diffhelpers_module = {
 	PyModuleDef_HEAD_INIT,
@@ -185,6 +187,7 @@
 											NULL, NULL);
 	Py_INCREF(diffhelpers_Error);
 	PyModule_AddObject(m, "diffhelpersError", diffhelpers_Error);
+	PyModule_AddIntConstant(m, "version", version);
 
 	return m;
 }
@@ -192,8 +195,10 @@
 PyMODINIT_FUNC
 initdiffhelpers(void)
 {
-	Py_InitModule3("diffhelpers", methods, diffhelpers_doc);
+	PyObject *m;
+	m = Py_InitModule3("diffhelpers", methods, diffhelpers_doc);
 	diffhelpers_Error = PyErr_NewException("diffhelpers.diffhelpersError",
 	                                        NULL, NULL);
+	PyModule_AddIntConstant(m, "version", version);
 }
 #endif