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

login
register
mail settings
Submitter Matt Harbison
Date Aug. 22, 2018, 2:55 a.m.
Message ID <42cc76d0f836d224cacb.1534906522@Envy>
Download mbox | patch
Permalink /patch/33958/
State Accepted
Headers show

Comments

Matt Harbison - Aug. 22, 2018, 2:55 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@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

Patch

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;