Comment 4 for bug 154283

Revision history for this message
Martin Pool (mbp) wrote :

and that message is with this patch applied

=== modified file 'bzrlib/knit.py'
--- bzrlib/knit.py 2007-10-22 01:23:51 +0000
+++ bzrlib/knit.py 2007-10-22 06:50:29 +0000
@@ -815,7 +815,17 @@
                 if method == 'fulltext':
                     next = None
                 else:
- next = self.get_parents(cursor)[0]
+ parents = self.get_parents(cursor)
+ try:
+ next = parents[0]
+ except IndexError:
+ raise KnitCorrupt(
+ self,
+ "\nversion %s\n"
+ " has compression method %r " \
+ "but index parents %r " % (
+ cursor, method, parents))
+ next = parents[0]
                 index_memo = self._index.get_position(cursor)
                 component_data[cursor] = (method, index_memo, next)
                 cursor = next