changeset 29213:4a3d55281a85

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.
author Sean Farley <sean@farley.io>
date Fri, 06 May 2016 18:00:03 -0700
parents 8005e0e0eb33
children ceca932c080d
files hgext/histedit.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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'})