Fix bug in lazymap code
authormpm@selenic.com
Tue, 17 May 2005 01:07:01 -0800
changeset 77 bed15e766511
parent 76 d993ebd69d28
child 78 85f1f87dc8ff
Fix bug in lazymap code Add a sanity check to addgroup
mercurial/revlog.py
--- a/mercurial/revlog.py	Tue May 17 00:33:22 2005 -0800
+++ b/mercurial/revlog.py	Tue May 17 01:07:01 2005 -0800
@@ -82,7 +82,7 @@
         self.p.load(pos)
     def __contains__(self, key):
         try:
-            self.p.map[key]
+            self[key]
             return True
         except KeyError:
             return False
@@ -434,6 +434,8 @@
         while pos < len(data):
             l, node, p1, p2, cs = struct.unpack(">l20s20s20s20s",
                                                 data[pos:pos+84])
+            if node in self.nodemap:
+                raise "already have %s" % hex(node[:4])
             link = linkmapper(cs)
             delta = data[pos + 84:pos + l]
             pos += l