Patchwork [6,of,6,V2] parsers: add version to help detect breaking binary changes

login
register
mail settings
Submitter Jun Wu
Date May 19, 2017, 3:46 p.m.
Message ID <67f77153a5d7091f4ce5.1495208773@x1c>
Download mbox | patch
Permalink /patch/20730/
State Accepted
Headers show

Comments

Jun Wu - May 19, 2017, 3:46 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1493167410 25200
#      Tue Apr 25 17:43:30 2017 -0700
# Node ID 67f77153a5d7091f4ce5ff665fd32bd0080f6b1f
# Parent  358a98a28d54b4c7c193e4f631641243d7f55dc7
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 67f77153a5d7
parsers: add version to help detect breaking binary changes

Patch

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -2855,6 +2855,10 @@  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