[PATCH] Begin commit messages with two empty lines

Martin Geisler mg at daimi.au.dk
Sat Mar 29 22:17:06 UTC 2008


# HG changeset patch
# User Martin Geisler <mg at daimi.au.dk>
# Date 1206828345 -3600
# Node ID 28baedcdde93e92dbfc90cd35bb60beb37644215
# Parent  f08662abdf3f3a4806e39bf64d208ea134857dc4
Begin commit messages with two empty lines.

This makes editors like Emacs wrap the commit message correctly. With
no empty line between the commit message and the 'HG:' lines, the
'HG:' lines would be wrapped as if they belonged to the commit message
and so lose their significance to Mercurial.

This makes no difference to what is stored by the commit -- whitespace
was already stripped from the beginning and end of commit messages.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -876,6 +876,7 @@ class localrepository(repo.repository):
                 if text:
                     edittext.append(text)
                 edittext.append("")
+                edittext.append("") # Empty line between message and comments.
                 edittext.append(_("HG: Enter commit message."
                                   "  Lines beginning with 'HG:' are removed."))
                 edittext.append("HG: --")



More information about the Mercurial-devel mailing list