##// END OF EJS Templates
histedit: drop the 'nodetoverify' method...
Pierre-Yves David -
r29874:0099e29f default
parent child Browse files
Show More
@@ -439,14 +439,6 b' class histeditaction(object):'
439 """
439 """
440 return set([_constraints.noduplicates, _constraints.noother])
440 return set([_constraints.noduplicates, _constraints.noother])
441
441
442 def nodetoverify(self):
443 """Returns a node associated with the action that will be used for
444 verification purposes.
445
446 If the action doesn't correspond to node it should return None
447 """
448 return self.node
449
450 def run(self):
442 def run(self):
451 """Runs the action. The default behavior is simply apply the action's
443 """Runs the action. The default behavior is simply apply the action's
452 rulectx onto the current parentctx."""
444 rulectx onto the current parentctx."""
@@ -1199,8 +1191,8 b' def _edithisteditplan(ui, repo, state, r'
1199 else:
1191 else:
1200 rules = _readfile(rules)
1192 rules = _readfile(rules)
1201 actions = parserules(rules, state)
1193 actions = parserules(rules, state)
1202 ctxs = [repo[act.nodetoverify()] \
1194 ctxs = [repo[act.node] \
1203 for act in state.actions if act.nodetoverify()]
1195 for act in state.actions if act.node]
1204 warnverifyactions(ui, repo, actions, state, ctxs)
1196 warnverifyactions(ui, repo, actions, state, ctxs)
1205 state.actions = actions
1197 state.actions = actions
1206 state.write()
1198 state.write()
@@ -1397,7 +1389,7 b' def verifyactions(actions, state, ctxs):'
1397 raise error.ParseError(_('unknown constraint "%s"') %
1389 raise error.ParseError(_('unknown constraint "%s"') %
1398 constraint)
1390 constraint)
1399
1391
1400 nodetoverify = action.nodetoverify()
1392 nodetoverify = action.node
1401 if nodetoverify is not None:
1393 if nodetoverify is not None:
1402 ha = node.hex(nodetoverify)
1394 ha = node.hex(nodetoverify)
1403 if _constraints.noother in constraints and ha not in expected:
1395 if _constraints.noother in constraints and ha not in expected:
@@ -1597,8 +1589,8 b' def stripwrapper(orig, ui, repo, nodelis'
1597 if os.path.exists(os.path.join(repo.path, 'histedit-state')):
1589 if os.path.exists(os.path.join(repo.path, 'histedit-state')):
1598 state = histeditstate(repo)
1590 state = histeditstate(repo)
1599 state.read()
1591 state.read()
1600 histedit_nodes = set([action.nodetoverify() for action
1592 histedit_nodes = set([action.node for action
1601 in state.actions if action.nodetoverify()])
1593 in state.actions if action.node])
1602 strip_nodes = set([repo[n].node() for n in nodelist])
1594 strip_nodes = set([repo[n].node() for n in nodelist])
1603 common_nodes = histedit_nodes & strip_nodes
1595 common_nodes = histedit_nodes & strip_nodes
1604 if common_nodes:
1596 if common_nodes:
General Comments 0
You need to be logged in to leave comments. Login now