changeset 27083:6d5d7ac41ef4

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.
author Mateusz Kwapich <mitrandir@fb.com>
date Thu, 12 Nov 2015 16:40:33 -0800
parents 4898e442f392
children 383f10b67fd6
files hgext/histedit.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Tue Nov 17 16:37:26 2015 -0800
+++ b/hgext/histedit.py	Thu Nov 12 16:40:33 2015 -0800
@@ -340,6 +340,7 @@
            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 @@
                 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])