revlog: make revlogv0 loading more robust against corruption
authorMatt Mackall <mpm@selenic.com>
Sat, 24 Nov 2007 12:13:32 -0600
changeset 5544 686899a7de5b
parent 5543 a3df02cd4a35
child 5546 92991422a847
revlog: make revlogv0 loading more robust against corruption
mercurial/revlog.py
--- 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