[PATCH 2 of 4] histedit: add forceother constraint

Mateusz Kwapich mitrandir at fb.com
Thu Nov 12 19:45:57 CST 2015


# HG changeset patch
# User Mateusz Kwapich <mitrandir at fb.com>
# Date 1447375233 28800
#      Thu Nov 12 16:40:33 2015 -0800
# Node ID 445d32ea992d69bd4f65d3343d3656985d22a8b0
# Parent  659c8c265d8516a5685ac226abc91aaa79028202
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.

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -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'])
@@ -1081,6 +1082,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])


More information about the Mercurial-devel mailing list