changeset 5544:686899a7de5b

revlog: make revlogv0 loading more robust against corruption
author Matt Mackall <mpm@selenic.com>
date Sat, 24 Nov 2007 12:13:32 -0600
parents a3df02cd4a35
children 92991422a847
files mercurial/revlog.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Wed Nov 21 13:26:18 2007 -0600
+++ b/mercurial/revlog.py	Sat Nov 24 12:13:32 2007 -0600
@@ -321,7 +321,7 @@
             e = _unpack(indexformatv0, cur)
             # transform to revlogv1 format
             e2 = (offset_type(e[0], 0), e[1], -1, e[2], e[3],
-                  nodemap[e[4]], nodemap[e[5]], e[6])
+                  nodemap.get(e[4], nullrev), nodemap.get(e[5], nullrev), e[6])
             index.append(e2)
             nodemap[e[6]] = n
             n += 1