##// END OF EJS Templates
pure: create type for revlog v0 index...
Martin von Zweigbergk -
r38885:da5a666f default
parent child Browse files
Show More
@@ -790,6 +790,14 b' indexformatv0 = struct.Struct(">4l20s20s'
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):
794 def __len__(self):
795 return list.__len__(self) + 1
796 def __getitem__(self, i):
797 if i == -1 or i == len(self) - 1:
798 return (0, 0, 0, -1, -1, -1, -1, nullid)
799 return list.__getitem__(self, i)
800
793 class revlogoldio(object):
801 class revlogoldio(object):
794 def __init__(self):
802 def __init__(self):
795 self.size = indexformatv0.size
803 self.size = indexformatv0.size
@@ -811,10 +819,7 b' class revlogoldio(object):'
811 nodemap[e[6]] = n
819 nodemap[e[6]] = n
812 n += 1
820 n += 1
813
821
814 # add the magic null revision at -1
822 return revlogoldindex(index), nodemap, None
815 index.append((0, 0, 0, -1, -1, -1, -1, nullid))
816
817 return index, nodemap, None
818
823
819 def packentry(self, entry, node, version, rev):
824 def packentry(self, entry, node, version, rev):
820 if gettype(entry[0]):
825 if gettype(entry[0]):
General Comments 0
You need to be logged in to leave comments. Login now