[PATCH 1 of 6] cext: fix revlog compiler error on Windows

Matt Harbison mharbison72 at gmail.com
Wed Aug 22 02:55:22 UTC 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1534899478 14400
#      Tue Aug 21 20:57:58 2018 -0400
# Node ID 42cc76d0f836d224cacb2441368cf4e546b6c47d
# Parent  7a759ad2d06dcf6548a8cc19fcd773eaa943f7ac
cext: fix revlog compiler error on Windows

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -1091,9 +1091,10 @@ static PyObject *nt_insert_py(nodetree *
 {
 	Py_ssize_t rev;
 	const char *node;
+	Py_ssize_t length;
 	if (!PyArg_ParseTuple(args, "n", &rev))
 		return NULL;
-	const Py_ssize_t length = index_length(self->index);
+	length = index_length(self->index);
 	if (rev < 0 || rev >= length) {
 		PyErr_SetString(PyExc_ValueError, "revlog index out of range");
 		return NULL;


More information about the Mercurial-devel mailing list