diff mercurial/revlog.py @ 8017:685ce2f7ee35

merge with -stable
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 06 Apr 2009 20:11:00 +0200
parents c63c30ae9e39 baaa832fd253
children e8a28556a0a8
line wrap: on
line diff
--- 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)