Patchwork [4,of,8,cleanup] histedit: temporally shorten name of 'constraints' variable

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 26, 2016, 7:35 p.m.
Message ID <de96a0de61f31c76df2a.1472240129@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/16460/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 26, 2016, 7:35 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1472236938 -7200
#      Fri Aug 26 20:42:18 2016 +0200
# Node ID de96a0de61f31c76df2a5315e443ab781299ab45
# Parent  21af9ca4b1bb79bcabd75556a21083a1ab6bc9a4
# EXP-Topic histedit.constraint
histedit: temporally shorten name of 'constraints' variable

Another coming changeset will make the line where this variable is used
slightly too long. Other later changesets will clean that up further and makes
the variable unnecessary, so this is only temporary and it does seems useful to
put anything more complicate in place.

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1379,25 +1379,25 @@  def verifyactions(actions, state, ctxs):
     for action in actions:
         action.verify(prev)
         prev = action
-        constraints = action.constraints
-        for constraint in constraints:
+        constrs = action.constraints
+        for constraint in constrs:
             if constraint not in _constraints.known():
                 raise error.ParseError(_('unknown constraint "%s"') %
                         constraint)
 
         if action.node is not None:
             ha = node.hex(action.node)
-            if _constraints.noother in constraints and ha not in expected:
+            if _constraints.noother in constrs and ha not in expected:
                 raise error.ParseError(
                     _('%s "%s" changeset was not a candidate')
                      % (action.verb, ha[:12]),
                     hint=_('only use listed changesets'))
-            if _constraints.forceother in constraints and ha in expected:
+            if _constraints.forceother in constrs and ha in expected:
                 raise error.ParseError(
                     _('%s "%s" changeset was not an edited list candidate')
                      % (action.verb, ha[:12]),
                     hint=_('only use listed changesets'))
-            if _constraints.noduplicates in constraints and ha in seen:
+            if _constraints.noduplicates in constrs and ha in seen:
                 raise error.ParseError(_(
                         'duplicated command for changeset %s') %
                         ha[:12])