# HG changeset patch # User Martin von Zweigbergk # Date 2018-08-05 06:15:03 # Node ID aa33988ad8ab4497e656d184ff322dddb506b0fc # Parent 899b4c74209c2a0c4786a1ce5beb1fdf0cc98801 index: return False for "len(index) in index" Since we no longer accept index[len(index)], we should clearly make "len(index) in index" return False. This should have been part of a3dacabd476b (index: don't allow index[len(index)] to mean nullid, 2018-07-20) Differential Revision: https://phab.mercurial-scm.org/D4104 diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c --- a/mercurial/cext/revlog.c +++ b/mercurial/cext/revlog.c @@ -1393,7 +1393,7 @@ static int index_contains(indexObject *s if (PyInt_Check(value)) { long rev = PyInt_AS_LONG(value); - return rev >= -1 && rev < index_length(self) + 1; + return rev >= -1 && rev < index_length(self); } if (node_check(value, &node) == -1)