Show More
@@ -155,7 +155,7 static PyObject *index_get(indexObject * | |||||
155 | int comp_len, uncomp_len, base_rev, link_rev, parent_1, parent_2; |
|
155 | int comp_len, uncomp_len, base_rev, link_rev, parent_1, parent_2; | |
156 | const char *c_node_id; |
|
156 | const char *c_node_id; | |
157 | const char *data; |
|
157 | const char *data; | |
158 |
Py_ssize_t length = index_length(self) |
|
158 | Py_ssize_t length = index_length(self); | |
159 | PyObject *entry; |
|
159 | PyObject *entry; | |
160 |
|
160 | |||
161 | if (pos == -1) { |
|
161 | if (pos == -1) { | |
@@ -163,7 +163,7 static PyObject *index_get(indexObject * | |||||
163 | return nullentry; |
|
163 | return nullentry; | |
164 | } |
|
164 | } | |
165 |
|
165 | |||
166 |
if (pos < 0 || pos >= length |
|
166 | if (pos < 0 || pos >= length) { | |
167 | PyErr_SetString(PyExc_IndexError, "revlog index out of range"); |
|
167 | PyErr_SetString(PyExc_IndexError, "revlog index out of range"); | |
168 | return NULL; |
|
168 | return NULL; | |
169 | } |
|
169 | } | |
@@ -225,13 +225,13 static PyObject *index_get(indexObject * | |||||
225 | */ |
|
225 | */ | |
226 | static const char *index_node(indexObject *self, Py_ssize_t pos) |
|
226 | static const char *index_node(indexObject *self, Py_ssize_t pos) | |
227 | { |
|
227 | { | |
228 |
Py_ssize_t length = index_length(self) |
|
228 | Py_ssize_t length = index_length(self); | |
229 | const char *data; |
|
229 | const char *data; | |
230 |
|
230 | |||
231 | if (pos == -1) |
|
231 | if (pos == -1) | |
232 | return nullid; |
|
232 | return nullid; | |
233 |
|
233 | |||
234 |
if (pos >= length |
|
234 | if (pos >= length) | |
235 | return NULL; |
|
235 | return NULL; | |
236 |
|
236 | |||
237 | if (pos >= self->length - 1) { |
|
237 | if (pos >= self->length - 1) { | |
@@ -285,7 +285,7 static PyObject *index_append(indexObjec | |||||
285 | if (node_check(PyTuple_GET_ITEM(obj, 7), &node) == -1) |
|
285 | if (node_check(PyTuple_GET_ITEM(obj, 7), &node) == -1) | |
286 | return NULL; |
|
286 | return NULL; | |
287 |
|
287 | |||
288 |
len = index_length(self) |
|
288 | len = index_length(self); | |
289 |
|
289 | |||
290 | if (self->added == NULL) { |
|
290 | if (self->added == NULL) { | |
291 | self->added = PyList_New(0); |
|
291 | self->added = PyList_New(0); | |
@@ -297,7 +297,7 static PyObject *index_append(indexObjec | |||||
297 | return NULL; |
|
297 | return NULL; | |
298 |
|
298 | |||
299 | if (self->nt) |
|
299 | if (self->nt) | |
300 |
nt_insert(self, node, len |
|
300 | nt_insert(self, node, len); | |
301 |
|
301 | |||
302 | Py_CLEAR(self->headrevs); |
|
302 | Py_CLEAR(self->headrevs); | |
303 | Py_RETURN_NONE; |
|
303 | Py_RETURN_NONE; | |
@@ -844,7 +844,7 static PyObject *index_deltachain(indexO | |||||
844 | int stoprev, iterrev, baserev = -1; |
|
844 | int stoprev, iterrev, baserev = -1; | |
845 | int stopped; |
|
845 | int stopped; | |
846 | PyObject *chain = NULL, *result = NULL; |
|
846 | PyObject *chain = NULL, *result = NULL; | |
847 |
const Py_ssize_t length = index_length(self) |
|
847 | const Py_ssize_t length = index_length(self); | |
848 |
|
848 | |||
849 | if (!PyArg_ParseTuple(args, "iOi", &rev, &stoparg, &generaldelta)) { |
|
849 | if (!PyArg_ParseTuple(args, "iOi", &rev, &stoparg, &generaldelta)) { | |
850 | return NULL; |
|
850 | return NULL; | |
@@ -865,7 +865,7 static PyObject *index_deltachain(indexO | |||||
865 | return NULL; |
|
865 | return NULL; | |
866 | } |
|
866 | } | |
867 |
|
867 | |||
868 |
if (rev < 0 || rev >= length |
|
868 | if (rev < 0 || rev >= length) { | |
869 | PyErr_SetString(PyExc_ValueError, "revlog index out of range"); |
|
869 | PyErr_SetString(PyExc_ValueError, "revlog index out of range"); | |
870 | return NULL; |
|
870 | return NULL; | |
871 | } |
|
871 | } | |
@@ -908,7 +908,7 static PyObject *index_deltachain(indexO | |||||
908 | break; |
|
908 | break; | |
909 | } |
|
909 | } | |
910 |
|
910 | |||
911 |
if (iterrev >= length |
|
911 | if (iterrev >= length) { | |
912 | PyErr_SetString(PyExc_IndexError, "revision outside index"); |
|
912 | PyErr_SetString(PyExc_IndexError, "revision outside index"); | |
913 | return NULL; |
|
913 | return NULL; | |
914 | } |
|
914 | } |
General Comments 0
You need to be logged in to leave comments.
Login now