Show More
@@ -158,12 +158,12 b' static PyObject *index_get(indexObject *' | |||||
158 | Py_ssize_t length = index_length(self) + 1; |
|
158 | Py_ssize_t length = index_length(self) + 1; | |
159 | PyObject *entry; |
|
159 | PyObject *entry; | |
160 |
|
160 | |||
161 |
if (pos == -1 |
|
161 | if (pos == -1) { | |
162 | Py_INCREF(nullentry); |
|
162 | Py_INCREF(nullentry); | |
163 | return nullentry; |
|
163 | return nullentry; | |
164 | } |
|
164 | } | |
165 |
|
165 | |||
166 | if (pos < 0 || pos >= length) { |
|
166 | if (pos < 0 || pos >= length - 1) { | |
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 | } |
@@ -792,7 +792,7 b' indexformatv0_unpack = indexformatv0.unp' | |||||
792 |
|
792 | |||
793 | class revlogoldindex(list): |
|
793 | class revlogoldindex(list): | |
794 | def __getitem__(self, i): |
|
794 | def __getitem__(self, i): | |
795 |
if i == -1 |
|
795 | if i == -1: | |
796 | return (0, 0, 0, -1, -1, -1, -1, nullid) |
|
796 | return (0, 0, 0, -1, -1, -1, -1, nullid) | |
797 | return list.__getitem__(self, i) |
|
797 | return list.__getitem__(self, i) | |
798 |
|
798 |
@@ -61,9 +61,6 b' def py_parseindex(data, inline) :' | |||||
61 | e[0] = offset_type(0, type) |
|
61 | e[0] = offset_type(0, type) | |
62 | index[0] = tuple(e) |
|
62 | index[0] = tuple(e) | |
63 |
|
63 | |||
64 | # add the magic null revision at -1 |
|
|||
65 | index.append((0, 0, 0, -1, -1, -1, -1, nullid)) |
|
|||
66 |
|
||||
67 | return index, cache |
|
64 | return index, cache | |
68 |
|
65 | |||
69 | data_inlined = ( |
|
66 | data_inlined = ( |
General Comments 0
You need to be logged in to leave comments.
Login now