# # add_file "tests/t_commit_log_writeback.at" # # patch "ChangeLog" # from [b013dc44e3cee5a8bf5a1f7e27f62c50ef763080] # to [e3ddf1aa6bd44fc6ed2063f94650089f4f372505] # # patch "tests/t_commit_log_writeback.at" # from [] # to [249e8f82f7c779dbc9de6d0c327ff2494dba91c6] # # patch "testsuite.at" # from [0cdcecc517caab0d82b22920ffade5dcd8107b52] # to [04b7e98cd3fddae17182003c92e29e869cacef6b] # ======================================================================== --- ChangeLog b013dc44e3cee5a8bf5a1f7e27f62c50ef763080 +++ ChangeLog e3ddf1aa6bd44fc6ed2063f94650089f4f372505 @@ -1,3 +1,8 @@ +2005-08-13 Nathaniel Smith + + * tests/t_commit_log_writeback.at: New test. + * testsuite.at: Add it. + 2005-08-12 Nathaniel Smith * commands.cc (commit): When user uses --message or ======================================================================== --- tests/t_commit_log_writeback.at +++ tests/t_commit_log_writeback.at 249e8f82f7c779dbc9de6d0c327ff2494dba91c6 @@ -0,0 +1,36 @@ +AT_SETUP([commit writes message back to MT/log]) +MONOTONE_SETUP + +ADD_FILE(testfile, [blah blah +]) + +# Make it unwriteable, so our edit_comment hook will have a chance to +# run, but the overall commit will fail. (How do I know this will +# work? Well, it did...) +AT_CHECK(chmod a-w test.db) + +AT_DATA(my_hook.lua, [function edit_comment(basetext, user_log_message) + return "foobar\n" +end +]) + +AT_CHECK(MONOTONE commit -btestbranch --rcfile=my_hook.lua, [1], [ignore], [ignore]) + +CHECK_SAME_CANONICALISED_STDOUT(echo "foobar", cat MT/log) + +AT_CHECK(rm -f MT/log) +AT_CHECK(touch MT/log) + +# -m messages don't get written out to MT/log +# (if they do, it breaks the workflow: +# $ monotone commit -m 'foo' +# +# +# $ monotone commit -m 'foo' +# error, MT/log non-empty and -m specified +AT_CHECK(MONOTONE commit -btestbranch -m "blah blah", [1], [ignore], [ignore]) + +# So MT/log should still be empty +AT_CHECK(test -s MT/log, [1]) + +AT_CLEANUP ======================================================================== --- testsuite.at 0cdcecc517caab0d82b22920ffade5dcd8107b52 +++ testsuite.at 04b7e98cd3fddae17182003c92e29e869cacef6b @@ -683,3 +683,4 @@ m4_include(tests/t_update_branch.at) m4_include(tests/t_commit_cancelled.at) m4_include(tests/t_merge_lca.at) +m4_include(tests/t_commit_log_writeback.at)