"Reopen": keywordmaps, how to get the commit message and the tag/label
Tony Mechelynck
antoine.mechelynck at gmail.com
Wed Sep 28 21:33:32 UTC 2011
On 28/09/11 21:13, Roland Schmitz wrote:
> Hi,
>
>
> Am Sonntag 25 September 2011 schrieb Roland Schmitz:
>>> $ hg help templates
> i thought that's it, but today i noticed, that there is a Problem with
> "multiline commit messages"
> Here's my hgrc:
> roli at blower:~/temp/log_message$ cat .hg/hgrc
> [ui]
> username = firstname lastname<f.lastname at example.com>
> merge = internal:merge
>
> [extensions]
> keyword =
>
> [keyword]
> **.pl =
>
> [keywordmaps]
> Author = {author}
> User = {user}
> Date = {date|isodate}
> Header = {root}/{file},v {node|short} {date|isodate} {author|user}
> Id = {file|basename} {rev}:{node|short} {date|isodate} {author|user}
> RCSfile = {file|basename},v
> Revision = {node|short}
> Source = {root}/{file},v
> LTag = {latesttag}
> LogComment = {desc}
>
> Here is the commit command where i noticed the Problem:
> roli at blower:~/temp/log_message$ hg commit -m 'Line 1: bla bla bla
>> Line 2: what ever
>> Line 3: everthing else'
>
> Here is the Perl source code file where i want to use this tags:
> roli at blower:~/temp/log_message$ cat dummy.pl
> #!/usr/bin/perl
> #===============================================================================
> #
> # FILE: dummy.pl
> #
> # USAGE: ./dummy.pl
> #
> # DESCRIPTION: $LogComment: Line 1: bla bla bla $
> #
> # letzter Tag: $LTag: null $
> #
> # OPTIONS: ---
> # REQUIREMENTS: ---
> # BUGS: ---
> # NOTES: ---
> # AUTHOR: $Author: firstname lastname<f.lastname at example.com> $
> # User: $User: $
> # COMPANY: FH Südwestfalen, Iserlohn
> # VERSION: 1.0
> # CREATED: $Date: 2011-09-28 21:04 +0200 $
> # REVISION: $Revision: 92b33d610ead $
> #===============================================================================
>
> use strict;
> use warnings;
>
> #die tolle aenderung
>
> exit;
>
>
> As you can see, only the first line of my commit message (Line 1: bla bla bla)
> is pasted into the source. Line no 2 "Line 2: what ever" and 3 "Line 3:
> everthing else" are left out. What do i have to do to see my complete commit
> message?
>
Try adding an editor line to the [ui] section of your .hgrc, (I use
editor = vim
but of course any plaintext editor would do), then committing without an
-m argument. Mercurial should open your favourite editor to create a
commit message.
Another possibility is to use the -l argument to commit or qnew (with a
filename) instead of -m (with a message): see hg help commit
Still another possibility would be to add your commit message as the
"heading garbage" (as the patch program manual calls it) at the top of
the patch file, before the actual first or only diff. This can for
instance be done before hg import.
When using "hg log" on one of my repos, I see some "descriptions"
spanning several lines, so it is possible to create multiline commit
messages somehow.
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
187. You promise yourself that you'll only stay online for another
15 minutes...at least once every hour.
More information about the Mercurial
mailing list