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

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


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1493167213 25200
#      Tue Apr 25 17:40:13 2017 -0700
# Node ID f9661db975a2e410b860d919ac6436af72b728c3
# Parent  bd01a5b895000ea8791540098b38ae78bed15a2f
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r f9661db975a2
diffhelpers: add version to help detect breaking binary changes

diff --git a/mercurial/diffhelpers.c b/mercurial/diffhelpers.c
--- a/mercurial/diffhelpers.c
+++ b/mercurial/diffhelpers.c
@@ -165,4 +165,6 @@ static PyMethodDef methods[] = {
 };
 
+static const int version = 1;
+
 #ifdef IS_PY3K
 static struct PyModuleDef diffhelpers_module = {
@@ -186,4 +188,5 @@ PyMODINIT_FUNC PyInit_diffhelpers(void)
 	Py_INCREF(diffhelpers_Error);
 	PyModule_AddObject(m, "diffhelpersError", diffhelpers_Error);
+	PyModule_AddIntConstant(m, "version", version);
 
 	return m;
@@ -193,7 +196,9 @@ 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


More information about the Mercurial-devel mailing list