diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1575,6 +1575,9 @@ useful when reusing a revision not stored in this revlog (ex: received over wire, or read from an external bundle). """ + if node == nullid: + raise RevlogError(_("%s: attempt to add null revision") % + (self.indexfile)) dfh = None if not self._inline: dfh = self.opener(self.datafile, "a+")