changeset 21923:e582e20cd3e6

commiteditor: refactor default extramsg
author Matt Mackall <mpm@selenic.com>
date Fri, 18 Jul 2014 23:15:28 -0500
parents 50e20154cb68
children 5375ba75df40
files mercurial/cmdutil.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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():