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

login
register
mail settings
Submitter Sean Farley
Date June 30, 2016, 9:58 p.m.
Message ID <b0e05869a929d0e2367e.1467323931@laptop.office.atlassian.com>
Download mbox | patch
Permalink /patch/15668/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Sean Farley - June 30, 2016, 9:58 p.m.
# HG changeset patch
# User Sean Farley <sean@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.

Patch

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