# HG changeset patch
# User Jun Wu <qu...@fb.com>
# Date 1493167116 25200
#      Tue Apr 25 17:38:36 2017 -0700
# Node ID 1cf8daf6404e811cf222f8075edf38265d2bd4c9
# Parent  f9661db975a2e410b860d919ac6436af72b728c3
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 1cf8daf6404e
mpatch: add version to help detect breaking binary changes

diff --git a/mercurial/mpatch_module.c b/mercurial/mpatch_module.c
--- a/mercurial/mpatch_module.c
+++ b/mercurial/mpatch_module.c
@@ -161,4 +161,6 @@ static PyMethodDef methods[] = {
 };
 
+static const int version = 1;
+
 #ifdef IS_PY3K
 static struct PyModuleDef mpatch_module = {
@@ -182,4 +184,5 @@ PyMODINIT_FUNC PyInit_mpatch(void)
        Py_INCREF(mpatch_Error);
        PyModule_AddObject(m, "mpatchError", mpatch_Error);
+       PyModule_AddIntConstant(m, "version", version);
 
        return m;
@@ -189,7 +192,9 @@ PyMODINIT_FUNC
 initmpatch(void)
 {
-       Py_InitModule3("mpatch", methods, mpatch_doc);
+       PyObject *m;
+       m = Py_InitModule3("mpatch", methods, mpatch_doc);
        mpatch_Error = PyErr_NewException("mercurial.mpatch.mpatchError",
                                          NULL, NULL);
+       PyModule_AddIntConstant(m, "version", version);
 }
 #endif
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to