monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] [PATCH] Specifying multiple --message arguments for com


From: Evan Deaubl
Subject: [Monotone-devel] [PATCH] Specifying multiple --message arguments for commits
Date: Sat, 30 Sep 2006 10:59:21 -0700
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

Hello everybody! I've been looking at Monotone for a while now, and I've been impressed by what I've seen so far, but I was looking for my first real-world experience with it. I figured what better way than to submit a patch for one of the quickie tasks.

Attached is a patch to add multiple --message argument handling for commits. I tested on a cygwin build, and both the new and existing commit message functionality work as expected.

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.

Review away, but remember: it's my first patch, be gentle. :-D

Changelog:

2006-09-30  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 [74564fc29941facbf83be83172dd42aa2eb27b32]
# 
# patch "monotone.texi"
#  from [cc29afef4a5d798896ea7403f747576293b2b4fe]
#    to [16849e6596eecfe68a87302c3f80c45a59f08e11]
# 
# patch "options_list.hh"
#  from [4b9a7e0040d1e356b56ca6908674b8eacbd93a6a]
#    to [7f848bd6cc61db450eec2b2b8d3af196c2aded71]
# 
============================================================
--- monotone.cc 8f218bf8b34745356232b79848b8a126c05c53f9
+++ monotone.cc 74564fc29941facbf83be83172dd42aa2eb27b32
@@ -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, "\n");
+          app.set_message(combined_message);
           app.set_is_explicit_option(option::message());
         }
 
============================================================
--- monotone.texi       cc29afef4a5d798896ea7403f747576293b2b4fe
+++ monotone.texi       16849e6596eecfe68a87302c3f80c45a59f08e11
@@ -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.
+Each @option{--message} option becomes an individual line in the resulting
+log message.
+
 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]