changeset 32360:af3ef002395d

parsers: add version to help detect breaking binary changes
author Jun Wu <quark@fb.com>
date Tue, 25 Apr 2017 17:43:30 -0700
parents dc51700be00c
children 124ee239d9cb
files mercurial/parsers.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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,