mercurial/revlog.py
changeset 8017 685ce2f7ee35
parent 7883 c63c30ae9e39
parent 8016 baaa832fd253
child 8073 e8a28556a0a8
equal deleted inserted replaced
8015:b5db7dcc1497 8017:685ce2f7ee35
   458 
   458 
   459         self._io = revlogio()
   459         self._io = revlogio()
   460         if self.version == REVLOGV0:
   460         if self.version == REVLOGV0:
   461             self._io = revlogoldio()
   461             self._io = revlogoldio()
   462         if i:
   462         if i:
   463             d = self._io.parseindex(f, self._inline)
   463             try:
       
   464                 d = self._io.parseindex(f, self._inline)
       
   465             except (ValueError, IndexError), e:
       
   466                 raise RevlogError(_("index %s is corrupted") % (self.indexfile))
   464             self.index, self.nodemap, self._chunkcache = d
   467             self.index, self.nodemap, self._chunkcache = d
   465 
   468 
   466         # add the magic null revision at -1 (if it hasn't been done already)
   469         # add the magic null revision at -1 (if it hasn't been done already)
   467         if (self.index == [] or isinstance(self.index, lazyindex) or
   470         if (self.index == [] or isinstance(self.index, lazyindex) or
   468             self.index[-1][7] != nullid) :
   471             self.index[-1][7] != nullid) :