histedit: add optional parameter for determining intial editor line
authorSean Farley <sean@farley.io>
Fri, 06 May 2016 18:00:03 -0700
changeset 29213 4a3d55281a85
parent 29212 8005e0e0eb33
child 29214 ceca932c080d
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.
hgext/histedit.py
--- 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'})