Patchwork D569: revlog: move check for wdir from changelog to revlog

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

Comments

phabricator - Aug. 31, 2017, 2:28 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbfb38c5cebf4: revlog: move check for wdir from changelog to revlog (authored by martinvonz).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D569?vs=1443&id=1470

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

AFFECTED FILES
  mercurial/changelog.py
  mercurial/revlog.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1697,6 +1697,10 @@ 
         if node == nullid:
             raise RevlogError(_("%s: attempt to add null revision") %
                               (self.indexfile))
+        if node == wdirid:
+            raise RevlogError(_("%s: attempt to add wdir revision") %
+                              (self.indexfile))
+
         btext = [rawtext]
         def buildtext():
             if btext[0] is not None:
diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -14,7 +14,6 @@ 
     bin,
     hex,
     nullid,
-    wdirid,
 )
 
 from . import (
@@ -536,9 +535,6 @@ 
         # 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')