comparison mercurial/pure/parsers.py @ 39216:ec6d5a9d1631

index: don't include nullid in boundary check in pure code Yet another change that should probably 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/D4333
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 18 Aug 2018 00:01:31 -0700
parents a1f934573c0b
children 5961517fd2a8
comparison
equal deleted inserted replaced
39215:eaa14dff3226 39216:ec6d5a9d1631
45 self._extra.append(tup) 45 self._extra.append(tup)
46 46
47 def _fix_index(self, i): 47 def _fix_index(self, i):
48 if not isinstance(i, int): 48 if not isinstance(i, int):
49 raise TypeError("expecting int indexes") 49 raise TypeError("expecting int indexes")
50 if i < 0 or i >= len(self) + 1: 50 if i < 0 or i >= len(self):
51 raise IndexError 51 raise IndexError
52 return i 52 return i
53 53
54 def __getitem__(self, i): 54 def __getitem__(self, i):
55 if i == -1: 55 if i == -1: