comparison mercurial/revlog.py @ 38852:a3dacabd476b

index: don't allow index[len(index)] to mean nullid Now everything else has been cleaned up and we can drop support for getting the nullid from the end of the index (from *past* the end actually, since we reduced the length in the previous patch). Differential Revision: https://phab.mercurial-scm.org/D4023
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 20 Jul 2018 14:36:42 -0700
parents 781b2720d2ac
children 18e866ae2a7d
comparison
equal deleted inserted replaced
38851:781b2720d2ac 38852:a3dacabd476b
790 indexformatv0_pack = indexformatv0.pack 790 indexformatv0_pack = indexformatv0.pack
791 indexformatv0_unpack = indexformatv0.unpack 791 indexformatv0_unpack = indexformatv0.unpack
792 792
793 class revlogoldindex(list): 793 class revlogoldindex(list):
794 def __getitem__(self, i): 794 def __getitem__(self, i):
795 if i == -1 or i == len(self): 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
799 class revlogoldio(object): 799 class revlogoldio(object):
800 def __init__(self): 800 def __init__(self):