diff hgext/histedit.py @ 27541:69df2081aeb5

histedit: pass previous action to verify
author timeless <timeless@mozdev.org>
date Mon, 28 Dec 2015 22:52:48 +0000
parents 88b32dcc25b6
children bf0900d3819c
line wrap: on
line diff
--- a/hgext/histedit.py	Thu Dec 17 14:56:14 2015 +0000
+++ b/hgext/histedit.py	Mon Dec 28 22:52:48 2015 +0000
@@ -358,7 +358,7 @@
         rulehash = rule.strip().split(' ', 1)[0]
         return cls(state, node.bin(rulehash))
 
-    def verify(self):
+    def verify(self, prev):
         """ Verifies semantic correctness of the rule"""
         repo = self.repo
         ha = node.hex(self.node)
@@ -1215,8 +1215,10 @@
     """
     expected = set(c.hex() for c in ctxs)
     seen = set()
+    prev = None
     for action in actions:
-        action.verify()
+        action.verify(prev)
+        prev = action
         constraints = action.constraints()
         for constraint in constraints:
             if constraint not in _constraints.known():