mercurial/parsers.c
changeset 22604 5e0d1478db8e
parent 22540 9a860ac8c216
child 22778 80f2b63dd83a
--- a/mercurial/parsers.c	Sun Sep 14 20:32:34 2014 -0400
+++ b/mercurial/parsers.c	Wed Oct 01 14:44:24 2014 -0500
@@ -687,9 +687,10 @@
 {
 	PyObject *obj;
 	char *node;
-	Py_ssize_t offset, len, nodelen;
+	int index;
+	Py_ssize_t len, nodelen;
 
-	if (!PyArg_ParseTuple(args, "nO", &offset, &obj))
+	if (!PyArg_ParseTuple(args, "iO", &index, &obj))
 		return NULL;
 
 	if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 8) {
@@ -702,21 +703,15 @@
 
 	len = index_length(self);
 
-	if (offset < 0)
-		offset += len;
+	if (index < 0)
+		index += len;
 
-	if (offset != len - 1) {
+	if (index != len - 1) {
 		PyErr_SetString(PyExc_IndexError,
 				"insert only supported at index -1");
 		return NULL;
 	}
 
-	if (offset > INT_MAX) {
-		PyErr_SetString(PyExc_ValueError,
-				"currently only 2**31 revs supported");
-		return NULL;
-	}
-
 	if (self->added == NULL) {
 		self->added = PyList_New(0);
 		if (self->added == NULL)
@@ -727,7 +722,7 @@
 		return NULL;
 
 	if (self->nt)
-		nt_insert(self, node, (int)offset);
+		nt_insert(self, node, index);
 
 	Py_CLEAR(self->headrevs);
 	Py_RETURN_NONE;