[PATCH 2 of 6 V2] histedit: remove unneeded initial parameter

Sean Farley sean at farley.io
Thu Jun 30 17:58:51 EDT 2016


# HG changeset patch
# User Sean Farley <sean at farley.io>
# Date 1464302580 25200
#      Thu May 26 15:43:00 2016 -0700
# Node ID b0e05869a929d0e2367e1815afdcada14499de5b
# Parent  fc14954300177abfd86358903adf37cd74ba2bfd
# EXP-Topic autoverb
histedit: remove unneeded initial parameter

Now that the autoverb logic no longer acts on an individual rule line,
we don't need this parameter since we apply our logic just once at the
time of initialization.

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -411,11 +411,11 @@ class histeditaction(object):
             self.node = repo[ha].node()
         except error.RepoError:
             raise error.ParseError(_('unknown changeset %s listed')
                               % ha[:12])
 
-    def torule(self, initial=False):
+    def torule(self):
         """build a histedit rule line for an action
 
         by default lines are in the form:
         <hash> <rev> <summary>
         """
@@ -1321,11 +1321,11 @@ def ruleeditor(repo, ui, actions, editco
             if fword.endswith('!'):
                 fword = fword[:-1]
                 if fword in primaryactions | secondaryactions | tertiaryactions:
                     act.verb = fword
 
-    rules = '\n'.join([act.torule(initial=True) for act in actions])
+    rules = '\n'.join([act.torule() for act in actions])
     rules += '\n\n'
     rules += editcomment
     rules = ui.edit(rules, ui.username(), {'prefix': 'histedit'})
 
     # Save edit rules in .hg/histedit-last-edit.txt in case


More information about the Mercurial-devel mailing list