diff --git a/hgext/histedit.py b/hgext/histedit.py index 0099e29fc95ce5108d616e3d2fdaa5e7c333fde0_aGdleHQvaGlzdGVkaXQucHk=..478e4a2a9952aafb31269691f231546a5ad4b725_aGdleHQvaGlzdGVkaXQucHk= 100644 --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -392,6 +392,8 @@ self.repo = state.repo self.node = node + constraints = set([_constraints.noduplicates, _constraints.noother]) + @classmethod def fromrule(cls, state, rule): """Parses the given rule, returning an instance of the histeditaction. @@ -434,11 +436,6 @@ """ return "%s\n%s" % (self.verb, node.hex(self.node)) - def constraints(self): - """Return a set of constrains that this action should be verified for - """ - return set([_constraints.noduplicates, _constraints.noother]) - def run(self): """Runs the action. The default behavior is simply apply the action's rulectx onto the current parentctx.""" @@ -776,8 +773,7 @@ return repo[n], replacements class base(histeditaction): - def constraints(self): - return set([_constraints.forceother]) + constraints = set([_constraints.forceother]) def run(self): if self.repo['.'].node() != self.node: @@ -1383,7 +1379,7 @@ for action in actions: action.verify(prev) prev = action - constraints = action.constraints() + constraints = action.constraints for constraint in constraints: if constraint not in _constraints.known(): raise error.ParseError(_('unknown constraint "%s"') %