monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] [PATCH] Specifying multiple --message arguments for


From: Evan Deaubl
Subject: Re: [Monotone-devel] [PATCH] Specifying multiple --message arguments for commits
Date: Sun, 01 Oct 2006 12:43:15 -0700
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

Thomas Moschny wrote:
On Saturday 30 September 2006 19:59 Evan Deaubl wrote:
The only thing I'm worried about is the line separator I used, but I
didn't see anywhere in the code where line separators were specified,
and I saw straight LFs being used most places, so I went with that.

Can't you simply use std::endl for that?

Not really, because I don't have a stream at the point where I need to know the platform newline character. I did notice a join_lines() that simply defaults the linesep argument to "\n", so I have switched to use that.

+Multiple @option{--message} options may be provided on the command line.
+Each @option{--message} option becomes an individual line in the resulting
+log message.

This might sound a bit confusing, as each commit message itself can consist of multiple lines.

Good point, I've changed the documentation to be a little more general.

ChangeLog:

2006-10-01  Evan Deaubl  <address@hidden>

        * monotone.cc, options_list.hh: Added ability to specify
        multiple --message arguments
        * monotone.texi: Added documentation for multiple --message
        arguments

Evan Deaubl
address@hidden
# 
# old_revision [a1f433f195d818776d8db68b8fc557da9f407cf7]
# 
# patch "monotone.cc"
#  from [8f218bf8b34745356232b79848b8a126c05c53f9]
#    to [d3f6609521fda6e768d0ed793841a07ebb2f42e0]
# 
# patch "monotone.texi"
#  from [cc29afef4a5d798896ea7403f747576293b2b4fe]
#    to [078917fbc125c59c2d5255ea6a802775a572333f]
# 
# patch "options_list.hh"
#  from [4b9a7e0040d1e356b56ca6908674b8eacbd93a6a]
#    to [7f848bd6cc61db450eec2b2b8d3af196c2aded71]
# 
============================================================
--- monotone.cc 8f218bf8b34745356232b79848b8a126c05c53f9
+++ monotone.cc d3f6609521fda6e768d0ed793841a07ebb2f42e0
@@ -38,6 +38,7 @@
 #include "options.hh"
 #include "paths.hh"
 #include "sha1.hh"
+#include "simplestring_xform.hh"
 
 using std::cout;
 using std::cerr;
@@ -432,7 +433,9 @@ cpp_main(int argc, char ** argv)
 
       if (option::message.given(vm))
         {
-          app.set_message(option::message.get(vm));
+          string combined_message = "";
+          join_lines(option::message.get(vm), combined_message);
+          app.set_message(combined_message);
           app.set_is_explicit_option(option::message());
         }
 
============================================================
--- monotone.texi       cc29afef4a5d798896ea7403f747576293b2b4fe
+++ monotone.texi       078917fbc125c59c2d5255ea6a802775a572333f
@@ -4168,14 +4168,14 @@ @section Workspace
 
 @item mtn commit
 @item mtn ci
address@hidden mtn commit address@hidden
address@hidden mtn ci address@hidden
address@hidden mtn commit address@hidden address@hidden
address@hidden mtn ci address@hidden address@hidden
 @itemx mtn commit address@hidden
 @itemx mtn ci address@hidden
 @itemx mtn commit @var{pathname...}
 @itemx mtn ci @var{pathname...}
address@hidden mtn commit address@hidden @var{pathname...} 
address@hidden mtn ci address@hidden @var{pathname...} 
address@hidden mtn commit address@hidden address@hidden @var{pathname...} 
address@hidden mtn ci address@hidden address@hidden @var{pathname...} 
 @itemx mtn commit address@hidden @var{pathname...} 
 @itemx mtn ci address@hidden @var{pathname...} 
 
@@ -4212,6 +4212,10 @@ @section Workspace
 @option{--message-file} actually specifies the name of the file containing
 the log message, while @option{--message} provides it directly.
 
+Multiple @option{--message} options may be provided on the command line.
+The log message will be formed by concatenating the @option{--message}
+options provided, with each one starting at the beginning of a new line.
+
 The @file{_MTN/log} file can be edited by the user during their daily work
 to record the changes made to the workspace. When running the
 @command{commit} command without a @var{logmsg} supplied, the contents
============================================================
--- options_list.hh     4b9a7e0040d1e356b56ca6908674b8eacbd93a6a
+++ options_list.hh     7f848bd6cc61db450eec2b2b8d3af196c2aded71
@@ -35,7 +35,7 @@ COPT(last, "last", long, gettext_noop("l
 COPT(external_diff_args, "diff-args", string, gettext_noop("argument to pass 
external diff hook"));
 COPT(key_to_push, "key-to-push", vector<string>, gettext_noop("push the 
specified key even if it hasn't signed anything"));
 COPT(last, "last", long, gettext_noop("limit log output to the last number of 
entries"));
-COPT(message, "message,m", string, gettext_noop("set commit changelog 
message"));
+COPT(message, "message,m", vector<string>, gettext_noop("set commit changelog 
message"));
 COPT(missing, "missing", nil, gettext_noop("perform the operations for files 
missing from workspace"));
 COPT(msgfile, "message-file", string, gettext_noop("set filename containing 
commit changelog message"));
 COPT(next, "next", long, gettext_noop("limit log output to the next number of 
entries"));

reply via email to

[Prev in Thread] Current Thread [Next in Thread]