# HG changeset patch # User Matt Mackall # Date 1405743328 18000 # Node ID e582e20cd3e6c6b0205ec94c4f2c1c6c348e1f78 # Parent 50e20154cb689ead60ecdf99d36ee4431868d180 commiteditor: refactor default extramsg diff -r 50e20154cb68 -r e582e20cd3e6 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Thu Jun 26 01:20:25 2014 +0200 +++ b/mercurial/cmdutil.py Fri Jul 18 23:15:28 2014 -0500 @@ -2171,6 +2171,8 @@ return commitforceeditor(repo, ctx, subs) def commitforceeditor(repo, ctx, subs, finishdesc=None, extramsg=None): + if not extramsg: + extramsg = _("Leave message empty to abort commit.") committext = buildcommittext(repo, ctx, subs, extramsg) # run editor in the repository root @@ -2196,10 +2198,7 @@ edittext.append("") # Empty line between message and comments. edittext.append(_("HG: Enter commit message." " Lines beginning with 'HG:' are removed.")) - if extramsg: - edittext.append("HG: %s" % extramsg) - else: - edittext.append(_("HG: Leave message empty to abort commit.")) + edittext.append("HG: %s" % extramsg) edittext.append("HG: --") edittext.append(_("HG: user: %s") % ctx.user()) if ctx.p2():