histedit: pass previous action to verify
authortimeless <timeless@mozdev.org>
Mon, 28 Dec 2015 22:52:48 +0000
changeset 27541 69df2081aeb5
parent 27540 9dcd55a63f0b
child 27542 bf0900d3819c
histedit: pass previous action to verify
hgext/histedit.py
--- 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():