Patchwork D522: revlog: abort on attempt to write null revision

login
register
mail settings
Submitter phabricator
Date Aug. 28, 2017, 2:01 p.m.
Message ID <3cbd036a9aa63896cdd30ee519280889@localhost.localdomain>
Download mbox | patch
Permalink /patch/23397/
State Not Applicable
Headers show

Comments

phabricator - Aug. 28, 2017, 2:01 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9180f8f593f3: revlog: abort on attempt to write null revision (authored by martinvonz).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D522?vs=1319&id=1348

REVISION DETAIL
  https://phab.mercurial-scm.org/D522

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: martinvonz, indygreg, #hg-reviewers, quark
Cc: quark, mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1694,6 +1694,9 @@ 
         - rawtext is optional (can be None); if not set, cachedelta must be set.
           if both are set, they must correspond to each other.
         """
+        if node == nullid:
+            raise RevlogError(_("%s: attempt to add null revision") %
+                              (self.indexfile))
         btext = [rawtext]
         def buildtext():
             if btext[0] is not None: