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: Tue, 03 Oct 2006 22:59:21 -0700
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

Yeah, I just noticed the current release simply grabs "line 2" for the message instead of failing, so the test would indeed pass on 0.30. I added a check to verify the commit message.

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

        * monotone.cc, options_list.hh: Added ability to specify
        multiple --message arguments
        * monotone.texi: Added documentation for multiple --message
        arguments
        * tests/multiple_message_commit/__driver__.lua, testsuite.lua:
        Added integration test for multiple --message arguments

Evan Deaubl
address@hidden

Nathaniel Smith wrote:
On Tue, Oct 03, 2006 at 09:40:02PM -0700, Evan Deaubl wrote:
============================================================
--- tests/multiple_message_commit/__driver__.lua        
7678a487298dc1340180abfd8a692f8684b5a527
+++ tests/multiple_message_commit/__driver__.lua        
7678a487298dc1340180abfd8a692f8684b5a527
@@ -0,0 +1,5 @@
+
+mtn_setup()
+
+addfile("a", "hello there")
+check(mtn("--debug", "commit", "--message", "line 1", "--message", "line 2"), 
0, false, false)

This is the right way to do it, except you're still not testing that
the new functionality actually works :-).  I'm pretty sure this test
would have succeeded without your patch, too, just it would have only
put "line 2" into the commit message...

Try calling "automate certs" on the base_revision, perhaps, maybe
adding --date to the commit command to make the output entirely
predictable (and thus easier to check for correctness)...

-- Nathaniel


# 
# old_revision [a1f433f195d818776d8db68b8fc557da9f407cf7]
# 
# add_dir "tests/multiple_message_commit"
# 
# add_file "tests/multiple_message_commit/__driver__.lua"
#  content [66fdeb0300c6f8c0ca33fbb2a728f8cc9ce73eee]
# 
# patch "monotone.cc"
#  from [8f218bf8b34745356232b79848b8a126c05c53f9]
#    to [d3f6609521fda6e768d0ed793841a07ebb2f42e0]
# 
# patch "monotone.texi"
#  from [cc29afef4a5d798896ea7403f747576293b2b4fe]
#    to [078917fbc125c59c2d5255ea6a802775a572333f]
# 
# patch "options_list.hh"
#  from [4b9a7e0040d1e356b56ca6908674b8eacbd93a6a]
#    to [7f848bd6cc61db450eec2b2b8d3af196c2aded71]
# 
# patch "testsuite.lua"
#  from [312ec6d69368d990e0d3337da4894e4ebd4f259b]
#    to [330b6858863b2d3868937c3191f54308c081a733]
# 
============================================================
--- tests/multiple_message_commit/__driver__.lua        
66fdeb0300c6f8c0ca33fbb2a728f8cc9ce73eee
+++ tests/multiple_message_commit/__driver__.lua        
66fdeb0300c6f8c0ca33fbb2a728f8cc9ce73eee
@@ -0,0 +1,6 @@
+
+mtn_setup()
+
+addfile("a", "hello there")
+check(mtn("--debug", "commit", "--message", "line 1", "--message", "line 2"), 
0, false, false)
+check(certvalue(base_revision(), "changelog") == "line 1\nline 2\n")
============================================================
--- 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"));
============================================================
--- testsuite.lua       312ec6d69368d990e0d3337da4894e4ebd4f259b
+++ testsuite.lua       330b6858863b2d3868937c3191f54308c081a733
@@ -682,3 +682,4 @@ table.insert(tests, "pivot_root_to_new_d
 table.insert(tests, "i18n_commit_messages")
 table.insert(tests, "ws_ops_with_wrong_node_type")
 table.insert(tests, "pivot_root_to_new_dir")
+table.insert(tests, "multiple_message_commit")

reply via email to

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