diff mercurial/revlog.py @ 34045:bfb38c5cebf4

revlog: move check for wdir from changelog to revlog Yuya said he preferred this (to keep them in one place, I think). Differential Revision: https://phab.mercurial-scm.org/D569
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 30 Aug 2017 09:21:31 -0700
parents b2eb0aa445cb
children b96cfc309ac5
line wrap: on
line diff
--- a/mercurial/revlog.py	Tue Aug 22 21:21:43 2017 -0400
+++ b/mercurial/revlog.py	Wed Aug 30 09:21:31 2017 -0700
@@ -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: