# # # patch "cmd_ws_commit.cc" # from [484d65233dbdbc8feec237c05108b8251e81ef7e] # to [c0319758a2916fcc143034a54b5e99f886714a94] # # patch "monotone.texi" # from [3e5b9a19d9af8f06af3b499e87d43658e233a14a] # to [4b3503d0874a4f98433b72c08051a51b60c6ec70] # # patch "rev_output.cc" # from [5b90e3cac54bb39eba9c5bba9cdc32490bb75c4e] # to [3dd86fa3304e75f321bab7892357dce2dfac33ec] # # patch "std_hooks.lua" # from [34cd38845eba0c0119042987efbbd7b4d7d1b62f] # to [eab67a0745db53c919b630124bf6fc5cd70bbbfe] # # patch "tests/changelog_editor/__driver__.lua" # from [e8991b59f2ef5c4e8d4d513eb7beee923c1969ef] # to [56b86ffc51a0bf5a60f2b10e578bdd631df76796] # # patch "tests/changelog_editor/changelog.lua" # from [39c618036605cd443ed0d0855b74cc323d409e9b] # to [395e1d1d8755263c93cd5f66486baa1d5e7957a4] # # patch "tests/commit_default_editor/test_hooks.lua" # from [a8b8f7005a4406d01a84d05f268d30e6c979432f] # to [acc4afeabd22d8a4dbe2329ca5907202d875b89f] # # patch "tests/commit_writes_message_back_to__MTN_log/my_hook.lua" # from [2d04630f7a5715dfe91c9e2188ab9b9834701b9d] # to [2a7cb74c1a3c220ce8f4446357d87f70e8988e22] # # patch "tests/i18n_commit_messages/extra_hooks.lua" # from [18f20cc69adabd0030cc12046147535b600aa9e8] # to [d80fb2f538a58b7ba6430e6b8af6305edaa2abb8] # # patch "tests/importing_cvs_metadata/expected_log_output" # from [abb52e3f4b0704dd65268bbab4737a9ae552480f] # to [1cd19bc2ebd7cf09842b51879d71d3a75812d39b] # # patch "tests/merge_into_workspace/expected-log" # from [423e88b22f687ec14c2692dccea7539ea29fec8b] # to [e43ddd168775004aa49e0dc8afc1ba8604b8678f] # # patch "tests/merge_into_workspace/expected-log-left" # from [c6ae73aeaecf79338e85684130e961bcd8660b16] # to [ff2b6b8ad837acf826dffa1ad07cd67714279805] # ============================================================ --- cmd_ws_commit.cc 484d65233dbdbc8feec237c05108b8251e81ef7e +++ cmd_ws_commit.cc c0319758a2916fcc143034a54b5e99f886714a94 @@ -130,19 +130,20 @@ get_log_message_interactively(lua_hooks get_log_message_interactively(lua_hooks & lua, workspace & work, revision_id const rid, revision_t const & rev, string & author, date_t & date, branch_name & branch, + set const & old_branches, string const & date_fmt, utf8 & log_message) { utf8 instructions( - _("Enter a description of this change following the ChangeLog line.\n" + _("Enter a description of this change following the Changelog line.\n" "The values of Author, Date and Branch may be modified as required.\n" - "Any other modifications will will cause the commit to fail.\n")); + "Any other modifications will cause the commit to fail.\n\n")); utf8 cancel(_("*** REMOVE THIS LINE TO CANCEL THE COMMIT ***\n")); utf8 changelog; work.read_user_log(changelog); - // ensure the changelog message is non-empty so that the ChangeLog: cert + // ensure the changelog message is non-empty so that the Changelog: cert // line is produced by revision_header and there is somewhere to enter a // message @@ -154,13 +155,28 @@ get_log_message_interactively(lua_hooks changelog = utf8(text, origin::user); } + ostringstream oss; + + oss << string(70, '-') << '\n'; + if (!old_branches.empty() && old_branches.find(branch) == old_branches.end()) + { + oss << _("This revision will create a new branch.") << '\n'; + for (set::const_iterator i = old_branches.begin(); + i != old_branches.end(); ++i) + oss << _("Old Branch: ") << *i << '\n'; + oss << _("New Branch: ") << branch << "\n\n"; + } + + utf8 notes(oss.str().c_str()); + utf8 header; utf8 summary; revision_header(rid, rev, author, date, branch, changelog, date_fmt, header); revision_summary(rev, summary); - utf8 full_message(instructions() + cancel() + header() + summary(), origin::internal); + utf8 full_message(instructions() + cancel() + header() + notes() + summary(), + origin::internal); external input_message; external output_message; @@ -179,12 +195,12 @@ get_log_message_interactively(lua_hooks // Check the message carefully to make sure the user didn't edit somewhere // outside of the author, date, branch or changelog values. The section - // between the "ChangeLog: " line from the header and the first - // "ChangeSet: " line from the summary is where they should be adding - // lines. Ideally, there is a blank line following "ChangeLog:" + // between the "Changelog: " line from the header and the following line + // of dashes preceeding the summary is where they should be adding + // lines. Ideally, there is a blank line following "Changelog:" // (preceeding the changelog message) and another blank line preceeding - // "ChangeSet: " (following the changelog message) but both of these are - // optional. + // the next line of dashes (following the changelog message) but both of + // these are optional. E(message.read(instructions()), origin::user, F("Commit failed. Instructions not found.")); @@ -195,14 +211,14 @@ get_log_message_interactively(lua_hooks utf8 const AUTHOR(trim_right(_("Author: ")).c_str()); utf8 const DATE(trim_right(_("Date: ")).c_str()); utf8 const BRANCH(trim_right(_("Branch: ")).c_str()); - utf8 const CHANGELOG(trim_right(_("ChangeLog: ")).c_str()); + utf8 const CHANGELOG(trim_right(_("Changelog: ")).c_str()); // ---------------------------------------------------------------------- // Revision: // Parent: // Parent: // Author: - + size_t pos = header().find(AUTHOR()); // look in unedited header I(pos != string::npos); @@ -249,22 +265,24 @@ get_log_message_interactively(lua_hooks string blank = message.readline(); E(blank == "", origin::user, - F("Commit failed. Blank line before ChangeLog header not found.")); + F("Commit failed. Blank line before Changelog header not found.")); - // ChangeLog: + // Changelog: E(message.read(CHANGELOG()), origin::user, - F("Commit failed. ChangeLog header not found.")); + F("Commit failed. Changelog header not found.")); // remove the summary before extracting the changelog content - if (!summary().empty()) + string footer = notes() + summary(); + + if (!footer.empty()) { - E(message.contains(summary()), origin::user, - F("Commit failed. ChangeSet summary not found.")); + E(message.contains(footer), origin::user, + F("Commit failed. Change summary not found.")); - E(message.remove(summary()), origin::user, - F("Commit failed. Text following ChangeSet summary.")); + E(message.remove(footer), origin::user, + F("Commit failed. Text following Change summary.")); } string content = trim(message.content()) + '\n'; @@ -772,15 +790,6 @@ CMD(status, "status", "", CMD_REF(inform set old_branches; get_old_branch_names(db, old_rosters, old_branches); - if (!old_branches.empty() && - old_branches.find(app.opts.branch) == old_branches.end()) - { - W(F("This revision will create a new branch")); - for (set::const_iterator i = old_branches.begin(); - i != old_branches.end(); ++i) - cout << _("Old Branch: ") << *i << '\n'; - cout << _("New Branch: ") << app.opts.branch << "\n\n"; - } utf8 changelog; work.read_user_log(changelog); @@ -798,8 +807,20 @@ CMD(status, "status", "", CMD_REF(inform utf8_to_system_best_effort(header, header_external); utf8_to_system_best_effort(summary, summary_external); - cout << header_external - << summary_external; + cout << header_external; + + if (!old_branches.empty() && + old_branches.find(app.opts.branch) == old_branches.end()) + { + cout << string(70, '-') << '\n' + << _("This revision will create a new branch.") << '\n'; + for (set::const_iterator i = old_branches.begin(); + i != old_branches.end(); ++i) + cout << _("Old Branch: ") << *i << '\n'; + cout << _("New Branch: ") << app.opts.branch << "\n\n"; + } + + cout << summary_external; } CMD(checkout, "checkout", "co", CMD_REF(tree), N_("[DIRECTORY]"), @@ -1295,6 +1316,9 @@ CMD(commit, "commit", "ci", CMD_REF(work restricted_rev.check_sane(); E(restricted_rev.is_nontrivial(), origin::user, F("no changes to commit")); + set old_branches; + get_old_branch_names(db, old_rosters, old_branches); + revision_id restricted_rev_id; calculate_ident(restricted_rev, restricted_rev_id); @@ -1331,7 +1355,8 @@ CMD(commit, "commit", "ci", CMD_REF(work process_commit_message_args(app.opts, log_message_given, log_message); - E(!(log_message_given && work.has_contents_user_log() && app.opts.msgfile() != "_MTN/log"), origin::user, + E(!(log_message_given && work.has_contents_user_log() && + app.opts.msgfile() != "_MTN/log"), origin::user, F("_MTN/log is non-empty and log message " "was specified on command line\n" "perhaps move or delete _MTN/log,\n" @@ -1390,7 +1415,7 @@ CMD(commit, "commit", "ci", CMD_REF(work // This call handles _MTN/log. get_log_message_interactively(app.lua, work, restricted_rev_id, restricted_rev, - author, date, app.opts.branch, + author, date, app.opts.branch, old_branches, date_fmt, log_message); // We only check for empty log messages when the user entered them ============================================================ --- monotone.texi 3e5b9a19d9af8f06af3b499e87d43658e233a14a +++ monotone.texi 4b3503d0874a4f98433b72c08051a51b60c6ec70 @@ -1479,6 +1479,7 @@ @section Adding Files @smallexample @group $ mtn status +FIXME Current branch: jp.co.juicebot.jb7 Changes against parent : added include/jb.h @@ -1876,6 +1877,7 @@ @section Making Changes @smallexample @group +FIXME polling implementation of src/apple.c MTN: ---------------------------------------------------------------------- MTN: Enter a description of this change. @@ -10649,6 +10651,8 @@ @subsection User Defaults for long and short date time formats, which is equivalent to @samp{22/05/09}, @samp{09:06:14} and @samp{22/05/09 09:06:14} in an English locale. +FIXME + @var{wanted} can be one of @samp{date_long}, @samp{date_short}, @samp{time_long}, @samp{time_short}, @samp{date_time_long} and @samp{date_time_short}, though only @samp{date_short} and ============================================================ --- rev_output.cc 5b90e3cac54bb39eba9c5bba9cdc32490bb75c4e +++ rev_output.cc 3dd86fa3304e75f321bab7892357dce2dfac33ec @@ -103,7 +103,7 @@ revision_header(revision_id const rid, r for (vector::const_iterator i = certs.begin(); i != certs.end(); ++i) if (i->name == changelog) { - out << _("ChangeLog: ") << "\n\n" << i->value << '\n'; + out << _("Changelog: ") << "\n\n" << i->value << '\n'; if (!i->value().empty() && i->value()[i->value().length()-1] != '\n') out << '\n'; } @@ -138,9 +138,9 @@ revision_summary(revision_t const & rev, // A colon at the end of this string looked nicer, but it made // double-click copying from terminals annoying. if (null_id(parent)) - out << _("ChangeSet: ") << "\n\n"; + out << _("Changes") << "\n\n"; else - out << _("ChangeSet: ") << parent << "\n\n"; + out << _("Changes against parent ") << parent << "\n\n"; // presumably a merge rev could have an empty edge if one side won if (cs.empty()) ============================================================ --- std_hooks.lua 34cd38845eba0c0119042987efbbd7b4d7d1b62f +++ std_hooks.lua eab67a0745db53c919b630124bf6fc5cd70bbbfe @@ -314,22 +314,22 @@ function edit_comment(user_log_message) if (not string.find(exe, "[^%w_.+-]")) then -- safe to call spawn directly if (execute(exe, tname) ~= 0) then - io.write(string.format(gettext("Error running editor '%s' ".. - "to enter log message\n"), + io.write(string.format(gettext("Error running editor '%s' ".. + "to enter log message\n"), exe)) - os.remove(tname) - return nil + os.remove(tname) + return nil end else -- must use shell local shell = os.getenv("SHELL") if (shell == nil) then shell = "sh" end if (not program_exists_in_path(shell)) then - io.write(string.format(gettext("Editor command '%s' needs a shell, ".. - "but '%s' is not to be found"), - exe, shell)) - os.remove(tname) - return nil + io.write(string.format(gettext("Editor command '%s' needs a shell, ".. + "but '%s' is not to be found"), + exe, shell)) + os.remove(tname) + return nil end -- Single-quoted strings in both Bourne shell and csh can contain @@ -337,11 +337,11 @@ function edit_comment(user_log_message) local safe_tname = " '" .. string.gsub(tname, "'", "'\\''") .. "'" if (execute(shell, "-c", editor .. safe_tname) ~= 0) then - io.write(string.format(gettext("Error running editor '%s' ".. - "to enter log message\n"), + io.write(string.format(gettext("Error running editor '%s' ".. + "to enter log message\n"), exe)) - os.remove(tname) - return nil + os.remove(tname) + return nil end end ============================================================ --- tests/changelog_editor/__driver__.lua e8991b59f2ef5c4e8d4d513eb7beee923c1969ef +++ tests/changelog_editor/__driver__.lua 56b86ffc51a0bf5a60f2b10e578bdd631df76796 @@ -88,35 +88,35 @@ check(qgrep("Branch value empty", "stder check(mtn("commit", "--rcfile=changelog.lua"), 1, false, true) check(qgrep("Branch value empty", "stderr")) --- commit fails with modified/missing blank line before ChangeLog section +-- commit fails with modified/missing blank line before Changelog section writefile("_MTN/log", "missing blank line") check(mtn("commit", "--rcfile=changelog.lua"), 1, false, true) -check(qgrep("ChangeLog header not found", "stderr")) +check(qgrep("Changelog header not found", "stderr")) --- commit fails with modified/missing ChangeLog section +-- commit fails with modified/missing Changelog section writefile("_MTN/log", "missing changelog") check(mtn("commit", "--rcfile=changelog.lua"), 1, false, true) -check(qgrep("ChangeLog header not found", "stderr")) +check(qgrep("Changelog header not found", "stderr")) --- commit fails with missing ChangeSet summary section +-- commit fails with missing Change summary section writefile("_MTN/log", "missing summary") check(mtn("commit", "--rcfile=changelog.lua"), 1, false, true) -check(qgrep("ChangeSet summary not found", "stderr")) +check(qgrep("Change summary not found", "stderr")) --- commit fails with duplicated ChangeSet: section +-- commit fails with duplicated Change summary section writefile("_MTN/log", "duplicated summary") check(mtn("commit", "--rcfile=changelog.lua"), 1, false, true) -check(qgrep("Text following ChangeSet summary", "stderr")) +check(qgrep("Text following Change summary", "stderr")) --- commit fails with new text after Changes: section +-- commit fails with new text after Change summary section writefile("_MTN/log", "trailing text") check(mtn("commit", "--rcfile=changelog.lua"), 1, false, true) -check(qgrep("Text following ChangeSet summary", "stderr")) +check(qgrep("Text following Change summary", "stderr")) -- commits that succeed @@ -161,13 +161,13 @@ check(qgrep("Date: 2010-01-01T01:01: check(mtn("log", "--last", "1", "--no-graph"), 0, true, false) check(qgrep("Date: 2010-01-01T01:01:01", "stdout")) --- message on same line as ChangeLog: header +-- message on same line as Changelog: header writefile("a", "a4") writefile("_MTN/log", "changelog line") check(mtn("commit", "--rcfile=changelog.lua"), 0, false, false) --- message filling entire ChangeLog section (no leading/trailing blank lines) +-- message filling entire Changelog section (no leading/trailing blank lines) writefile("a", "a5") writefile("_MTN/log", "full changelog") ============================================================ --- tests/changelog_editor/changelog.lua 39c618036605cd443ed0d0855b74cc323d409e9b +++ tests/changelog_editor/changelog.lua 395e1d1d8755263c93cd5f66486baa1d5e7957a4 @@ -27,13 +27,13 @@ function edit_comment(user_log_file) elseif (string.find(user_log_file, "\nempty branch\n")) then return string.gsub(user_log_file, "\nBranch: [^\n]*\n", "\nBranch: \n") elseif (string.find(user_log_file, "\nmissing blank line\n")) then - return string.gsub(user_log_file, "\n\nChangeLog:", "\nChangeLog:") + return string.gsub(user_log_file, "\n\nChangelog:", "\nChangelog:") elseif (string.find(user_log_file, "\nmissing changelog\n")) then - return string.gsub(user_log_file, "\nChangeLog:", "\n") + return string.gsub(user_log_file, "\nChangelog:", "\n") elseif (string.find(user_log_file, "\nmissing summary\n")) then - return string.gsub(user_log_file, "\nChangeSet: ", "\nChange foobar") + return string.gsub(user_log_file, "\nChanges against parent ", "\nChange foobar") elseif (string.find(user_log_file, "\nduplicated summary\n")) then - return string.gsub(user_log_file, "(ChangeSet: .*)", "%1%1") + return string.gsub(user_log_file, "(Changes against parent .*)", "%1%1") elseif (string.find(user_log_file, "\ntrailing text\n")) then return user_log_file .. "foobar" end @@ -49,13 +49,13 @@ function edit_comment(user_log_file) elseif (string.find(user_log_file, "\nsleep\n")) then date = string.match(user_log_file, "\nDate: ([^\n]*)") sleep(2) - return string.gsub(user_log_file, "\nChangeLog: \n\nsleep", "\nChangeLog: \n\nOld: " .. date) + return string.gsub(user_log_file, "\nChangelog: \n\nsleep", "\nChangelog: \n\nOld: " .. date) elseif (string.find(user_log_file, "\nchange date\n")) then return string.gsub(user_log_file, "\nDate: [^\n]*\n", "\nDate: 2010-01-01T01:01:01\n") elseif (string.find(user_log_file, "\nchangelog line\n")) then - return string.gsub(user_log_file, "\nChangeLog: \n\nchangelog line", "\nChangeLog:message on changelog line") + return string.gsub(user_log_file, "\nChangelog: \n\nchangelog line", "\nChangelog:message on changelog line") elseif (string.find(user_log_file, "\nfull changelog\n")) then - return string.gsub(user_log_file, "\nChangeLog: .*\nChangeSet:", "\nChangeLog:no\nspace\naround\nthis\nchangelog\nChangeSet:") + return string.gsub(user_log_file, "\nChangelog: \n\nfull changelog\n\n", "\nChangelog:no\nspace\naround\nthis\nchangelog\n-----") end return user_log_file ============================================================ --- tests/commit_default_editor/test_hooks.lua a8b8f7005a4406d01a84d05f268d30e6c979432f +++ tests/commit_default_editor/test_hooks.lua acc4afeabd22d8a4dbe2329ca5907202d875b89f @@ -10,7 +10,7 @@ function execute(path,...) text = tmp:read("*a") io.close(tmp) - text = string.gsub(text, "\nChangeLog: \n\n\n", "\nChangeLog: \n\nHello\n") + text = string.gsub(text, "\nChangelog: \n\n\n", "\nChangelog: \n\nHello\n") tmp = io.open(tname, "w") tmp:write(text) ============================================================ --- tests/commit_writes_message_back_to__MTN_log/my_hook.lua 2d04630f7a5715dfe91c9e2188ab9b9834701b9d +++ tests/commit_writes_message_back_to__MTN_log/my_hook.lua 2a7cb74c1a3c220ce8f4446357d87f70e8988e22 @@ -1,3 +1,3 @@ function edit_comment(user_log_file) function edit_comment(user_log_file) - return string.gsub(user_log_file, "\nChangeLog: \n\n\n", "\nChangeLog: \n\nfoobar\n") + return string.gsub(user_log_file, "\nChangelog: \n\n\n", "\nChangelog: \n\nfoobar\n") end ============================================================ --- tests/i18n_commit_messages/extra_hooks.lua 18f20cc69adabd0030cc12046147535b600aa9e8 +++ tests/i18n_commit_messages/extra_hooks.lua d80fb2f538a58b7ba6430e6b8af6305edaa2abb8 @@ -16,11 +16,11 @@ function edit_comment(user_log_message) io.write("EDIT: BASE BAD\n") end - if string.find(user_log_message, "\nChangeLog: \n\n\n") ~= nil then + if string.find(user_log_message, "\nChangelog: \n\n\n") ~= nil then io.write("EDIT: MSG NONESUCH\n") - return string.gsub(user_log_message, "\nChangeLog: \n\n\n", "\nChangeLog: \n\n" .. wanted .. "\n") + return string.gsub(user_log_message, "\nChangelog: \n\n\n", "\nChangelog: \n\n" .. wanted .. "\n") else - if string.find(user_log_message, "\nChangeLog: \n\n" .. wanted .. "\n") ~= nil then + if string.find(user_log_message, "\nChangelog: \n\n" .. wanted .. "\n") ~= nil then io.write("EDIT: MSG GOOD\n") else io.write("EDIT: MSG BAD\n") ============================================================ --- tests/importing_cvs_metadata/expected_log_output abb52e3f4b0704dd65268bbab4737a9ae552480f +++ tests/importing_cvs_metadata/expected_log_output 1cd19bc2ebd7cf09842b51879d71d3a75812d39b @@ -4,11 +4,11 @@ Branch: testbranch Date: 2009-09-11T16:37:48 Branch: testbranch -ChangeLog: +Changelog: test -ChangeSet: +Changes added added test.txt ============================================================ --- tests/merge_into_workspace/expected-log 423e88b22f687ec14c2692dccea7539ea29fec8b +++ tests/merge_into_workspace/expected-log e43ddd168775004aa49e0dc8afc1ba8604b8678f @@ -5,11 +5,11 @@ Branch: testbranch Date: 2007-02-28T02:09:14 Branch: testbranch -ChangeLog: +Changelog: blah-blah -ChangeSet: 87c726bb950efb3d809662b86700a8566346970d +Changes against parent 87c726bb950efb3d809662b86700a8566346970d patched testfile @@ -20,11 +20,11 @@ Branch: testbranch Date: 2007-02-28T02:09:13 Branch: testbranch -ChangeLog: +Changelog: blah-blah -ChangeSet: 87c726bb950efb3d809662b86700a8566346970d +Changes against parent 87c726bb950efb3d809662b86700a8566346970d patched testfile @@ -34,11 +34,11 @@ Branch: testbranch Date: 2007-02-28T02:09:12 Branch: testbranch -ChangeLog: +Changelog: blah-blah -ChangeSet: +Changes added added otherfile ============================================================ --- tests/merge_into_workspace/expected-log-left c6ae73aeaecf79338e85684130e961bcd8660b16 +++ tests/merge_into_workspace/expected-log-left ff2b6b8ad837acf826dffa1ad07cd67714279805 @@ -5,11 +5,11 @@ Branch: testbranch Date: 2007-02-28T02:11:20 Branch: testbranch -ChangeLog: +Changelog: blah-blah -ChangeSet: 87c726bb950efb3d809662b86700a8566346970d +Changes against parent 87c726bb950efb3d809662b86700a8566346970d patched testfile @@ -19,11 +19,11 @@ Branch: testbranch Date: 2007-02-28T02:11:19 Branch: testbranch -ChangeLog: +Changelog: blah-blah -ChangeSet: +Changes added added otherfile