Read about our upcoming Code of Conduct on this issue

Commit 9bc0158a authored by Mateusz Kwapich's avatar Mateusz Kwapich
Browse files

histedit: add forceother constraint

For the future 'base' action in histedit we need a verification
constraint which will not allow using this action with changes
that are currently edited.
parent 4898e442f392
......@@ -340,6 +340,7 @@ class histeditaction(object):
Available constraints:
noduplicates - aborts if there are multiple rules for one node
noother - abort if the node doesn't belong to edited stack
forceother - abort if the node does belong to edited stack
"""
return set(['noduplicates', 'noother'])
......@@ -1087,6 +1088,10 @@ def verifyrules(rules, state, ctxs):
raise error.Abort(
_('may not use "%s" with changesets '
'other than the ones listed') % verb)
if 'forceother' in constraints and ha in expected:
raise error.Abort(
_('may not use "%s" with changesets '
'within the edited list') % verb)
if 'noduplicates' in constraints and ha in seen:
raise error.Abort(_('duplicated command for changeset %s') %
ha[:12])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment