mercurial/revlog.py
changeset 4061 40030c1b6bc6
parent 3930 01d98d68d697
child 4224 2a8b6d78d7ee
equal deleted inserted replaced
4060:82eb0fafb56d 4061:40030c1b6bc6
   144                 blocksize = max(self.datasize - blockstart, 0)
   144                 blocksize = max(self.datasize - blockstart, 0)
   145             data = self.dataf.read(blocksize)
   145             data = self.dataf.read(blocksize)
   146         lend = len(data) / self.s
   146         lend = len(data) / self.s
   147         i = blockstart / self.s
   147         i = blockstart / self.s
   148         off = 0
   148         off = 0
       
   149         # lazyindex supports __delitem__
       
   150         if lend > len(self.index) - i:
       
   151             lend = len(self.index) - i
   149         for x in xrange(lend):
   152         for x in xrange(lend):
   150             if self.index[i + x] == None:
   153             if self.index[i + x] == None:
   151                 b = data[off : off + self.s]
   154                 b = data[off : off + self.s]
   152                 self.index[i + x] = b
   155                 self.index[i + x] = b
   153                 n = b[self.shaoffset:self.shaoffset + 20]
   156                 n = b[self.shaoffset:self.shaoffset + 20]