histedit: add optional parameter for determining intial editor line
A simple refactor to allow us to change the default verb for the initial editor
display.
--- a/hgext/histedit.py Sat May 14 14:16:43 2016 +0900
+++ b/hgext/histedit.py Fri May 06 18:00:03 2016 -0700
@@ -413,7 +413,7 @@
raise error.ParseError(_('unknown changeset %s listed')
% ha[:12])
- def torule(self):
+ def torule(self, initial=False):
"""build a histedit rule line for an action
by default lines are in the form:
@@ -1309,7 +1309,7 @@
rules are in the format [ [act, ctx], ...] like in state.rules
"""
- rules = '\n'.join([act.torule() for act in actions])
+ rules = '\n'.join([act.torule(initial=True) for act in actions])
rules += '\n\n'
rules += editcomment
rules = ui.edit(rules, ui.username(), {'prefix': 'histedit'})