Show More
@@ -995,6 +995,40 b' static inline int index_baserev(indexObj' | |||||
995 | return result; |
|
995 | return result; | |
996 | } |
|
996 | } | |
997 |
|
997 | |||
|
998 | /** | |||
|
999 | * Find if a revision is a snapshot or not | |||
|
1000 | * | |||
|
1001 | * Only relevant for sparse-revlog case. | |||
|
1002 | * Callers must ensure that rev is in a valid range. | |||
|
1003 | */ | |||
|
1004 | static int index_issnapshotrev(indexObject *self, Py_ssize_t rev) | |||
|
1005 | { | |||
|
1006 | int ps[2]; | |||
|
1007 | Py_ssize_t base; | |||
|
1008 | while (rev >= 0) { | |||
|
1009 | base = (Py_ssize_t)index_baserev(self, rev); | |||
|
1010 | if (base == rev) { | |||
|
1011 | base = -1; | |||
|
1012 | } | |||
|
1013 | if (base == -2) { | |||
|
1014 | assert(PyErr_Occurred()); | |||
|
1015 | return -1; | |||
|
1016 | } | |||
|
1017 | if (base == -1) { | |||
|
1018 | return 1; | |||
|
1019 | } | |||
|
1020 | if (index_get_parents(self, rev, ps, (int)rev) < 0) { | |||
|
1021 | assert(PyErr_Occurred()); | |||
|
1022 | return -1; | |||
|
1023 | }; | |||
|
1024 | if (base == ps[0] || base == ps[1]) { | |||
|
1025 | return 0; | |||
|
1026 | } | |||
|
1027 | rev = base; | |||
|
1028 | } | |||
|
1029 | return rev == -1; | |||
|
1030 | } | |||
|
1031 | ||||
998 | static PyObject *index_deltachain(indexObject *self, PyObject *args) |
|
1032 | static PyObject *index_deltachain(indexObject *self, PyObject *args) | |
999 | { |
|
1033 | { | |
1000 | int rev, generaldelta; |
|
1034 | int rev, generaldelta; |
General Comments 0
You need to be logged in to leave comments.
Login now