--- a/mercurial/revlog.py Mon Apr 06 16:26:57 2009 +0200
+++ b/mercurial/revlog.py Mon Apr 06 20:11:00 2009 +0200
@@ -460,7 +460,10 @@
if self.version == REVLOGV0:
self._io = revlogoldio()
if i:
- d = self._io.parseindex(f, self._inline)
+ try:
+ d = self._io.parseindex(f, self._inline)
+ except (ValueError, IndexError), e:
+ raise RevlogError(_("index %s is corrupted") % (self.indexfile))
self.index, self.nodemap, self._chunkcache = d
# add the magic null revision at -1 (if it hasn't been done already)