# HG changeset patch # User Sean Farley # Date 1462582803 25200 # Node ID 4a3d55281a8515bab8fe4cb0493e2850433e178b # Parent 8005e0e0eb33b9bdfdcc9dfe9b2e58833a888254 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. diff -r 8005e0e0eb33 -r 4a3d55281a85 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'})