Patchwork [1,of,7] histedit: pass previous action to verify

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 28, 2015, 11:29 p.m.
Message ID <4ae45cf8a383d0a948cb.1451345352@waste.org>
Download mbox | patch
Permalink /patch/12381/
State Accepted
Headers show

Comments

timeless@mozdev.org - Dec. 28, 2015, 11:29 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1451343168 0
#      Mon Dec 28 22:52:48 2015 +0000
# Node ID 4ae45cf8a383d0a948cbccedc7e9f3c699e2fd27
# Parent  23541bdd1610c08af247f9c8719045cf247ce541
histedit: pass previous action to verify

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -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():