mercurial/cext/revlog.c
changeset 39228 66f046116105
parent 39227 42cc76d0f836
child 39291 9f097214fbf3
equal deleted inserted replaced
39227:42cc76d0f836 39228:66f046116105
   455 		while ((iter_item = PyIter_Next(iter))) {
   455 		while ((iter_item = PyIter_Next(iter))) {
   456 			iter_item_long = PyInt_AS_LONG(iter_item);
   456 			iter_item_long = PyInt_AS_LONG(iter_item);
   457 			Py_DECREF(iter_item);
   457 			Py_DECREF(iter_item);
   458 			if (iter_item_long < min_idx)
   458 			if (iter_item_long < min_idx)
   459 				min_idx = iter_item_long;
   459 				min_idx = iter_item_long;
   460 			phases[iter_item_long] = marker;
   460 			phases[iter_item_long] = (char)marker;
   461 		}
   461 		}
   462 		Py_DECREF(iter);
   462 		Py_DECREF(iter);
   463 	}
   463 	}
   464 
   464 
   465 	return min_idx;
   465 	return min_idx;
  1098 	if (rev < 0 || rev >= length) {
  1098 	if (rev < 0 || rev >= length) {
  1099 		PyErr_SetString(PyExc_ValueError, "revlog index out of range");
  1099 		PyErr_SetString(PyExc_ValueError, "revlog index out of range");
  1100 		return NULL;
  1100 		return NULL;
  1101 	}
  1101 	}
  1102 	node = index_node_existing(self->index, rev);
  1102 	node = index_node_existing(self->index, rev);
  1103 	if (nt_insert(self, node, rev) == -1)
  1103 	if (nt_insert(self, node, (int)rev) == -1)
  1104 		return NULL;
  1104 		return NULL;
  1105 	Py_RETURN_NONE;
  1105 	Py_RETURN_NONE;
  1106 }
  1106 }
  1107 
  1107 
  1108 static int nt_delete_node(nodetree *self, const char *node)
  1108 static int nt_delete_node(nodetree *self, const char *node)
  1281 	if (self->nt == NULL) {
  1281 	if (self->nt == NULL) {
  1282 		self->nt = PyObject_New(nodetree, &nodetreeType);
  1282 		self->nt = PyObject_New(nodetree, &nodetreeType);
  1283 		if (self->nt == NULL) {
  1283 		if (self->nt == NULL) {
  1284 			return -1;
  1284 			return -1;
  1285 		}
  1285 		}
  1286 		if (nt_init(self->nt, self, self->raw_length) == -1) {
  1286 		if (nt_init(self->nt, self, (int)self->raw_length) == -1) {
  1287 			nt_dealloc(self->nt);
  1287 			nt_dealloc(self->nt);
  1288 			self->nt = NULL;
  1288 			self->nt = NULL;
  1289 			return -1;
  1289 			return -1;
  1290 		}
  1290 		}
  1291 		if (nt_insert(self->nt, nullid, -1) == -1) {
  1291 		if (nt_insert(self->nt, nullid, -1) == -1) {