mercurial/revlog.py
changeset 19326 7014526d67a8
parent 19200 4cfdec944edf
child 19471 fd1bb7c1be78
--- a/mercurial/revlog.py	Wed Jun 19 14:17:03 2013 -0500
+++ b/mercurial/revlog.py	Mon Jun 17 19:44:00 2013 -0700
@@ -991,6 +991,9 @@
         p1, p2 - the parent nodeids of the revision
         cachedelta - an optional precomputed delta
         """
+        if link == nullrev:
+            raise RevlogError(_("attempted to add linkrev -1 to %s")
+                              % self.indexfile)
         node = hash(text, p1, p2)
         if node in self.nodemap:
             return node