Add safety check for addgroup
authorMatt Mackall <mpm@selenic.com>
Mon, 07 Nov 2005 15:40:24 -0800
changeset 1509 46a07392cf28
parent 1508 b254243b7159
child 1510 755e7ac351ef
Add safety check for addgroup
mercurial/revlog.py
--- a/mercurial/revlog.py	Fri Nov 04 11:37:45 2005 -0800
+++ b/mercurial/revlog.py	Mon Nov 07 15:40:24 2005 -0800
@@ -784,6 +784,10 @@
                 continue
             delta = chunk[80:]
 
+            for p in (p1, p2):
+                if not p in self.nodemap:
+                    raise RevlogError(_("unknown parent %s") % short(p1))
+
             if not chain:
                 # retrieve the parent revision of the delta chain
                 chain = p1