Patchwork D524: changelog: abort on attempt to write wdir revision

login
register
mail settings
Submitter phabricator
Date Aug. 28, 2017, 7:05 p.m.
Message ID <993477ccfc45aa96decaa6900e1873ae@localhost.localdomain>
Download mbox | patch
Permalink /patch/23436/
State Not Applicable
Headers show

Comments

phabricator - Aug. 28, 2017, 7:05 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3939b30d0cb7: changelog: abort on attempt to write wdir revision (authored by martinvonz).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D524?vs=1320&id=1364

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

AFFECTED FILES
  mercurial/changelog.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -14,6 +14,7 @@ 
     bin,
     hex,
     nullid,
+    wdirid,
 )
 
 from . import (
@@ -535,6 +536,9 @@ 
         # overlay over the standard revlog._addrevision to track the new
         # revision on the transaction.
         rev = len(self)
+        if node == wdirid: # nullid is checked in super method
+            raise error.RevlogError(_("%s: attempt to add wdir revision") %
+                                    (self.indexfile))
         node = super(changelog, self)._addrevision(node, rawtext, transaction,
                                                    *args, **kwargs)
         revs = transaction.changes.get('revs')