# HG changeset patch # User Jun Wu # Date 1493167019 25200 # Node ID dc51700be00c421a8dc4b0fc1b50dd4ce9ccd3e9 # Parent 5fc3459d04935b06253bd1ce3aa197e5b75e8934 osutil: add version to help detect breaking binary changes See the previous patch for why. diff -r 5fc3459d0493 -r dc51700be00c mercurial/osutil.c --- a/mercurial/osutil.c Tue Apr 25 17:38:36 2017 -0700 +++ b/mercurial/osutil.c Tue Apr 25 17:36:59 2017 -0700 @@ -1301,6 +1301,8 @@ {NULL, NULL} }; +static const int version = 1; + #ifdef IS_PY3K static struct PyModuleDef osutil_module = { PyModuleDef_HEAD_INIT, @@ -1312,17 +1314,22 @@ PyMODINIT_FUNC PyInit_osutil(void) { + PyObject *m; if (PyType_Ready(&listdir_stat_type) < 0) return NULL; - return PyModule_Create(&osutil_module); + m = PyModule_Create(&osutil_module); + PyModule_AddIntConstant(m, "version", version); + return m; } #else PyMODINIT_FUNC initosutil(void) { + PyObject *m; if (PyType_Ready(&listdir_stat_type) == -1) return; - Py_InitModule3("osutil", methods, osutil_doc); + m = Py_InitModule3("osutil", methods, osutil_doc); + PyModule_AddIntConstant(m, "version", version); } #endif