# # # patch "cmd_ws_commit.cc" # from [e6909c953f9df3a824f8ebb0624c5f4c59d6e9e0] # to [ca903e187f3cf617bf5ab1abbab65f36fc8b2b8b] # # patch "rev_output.cc" # from [8cb1fadbcd79aab23bf95c26aec3390f4fa950d6] # to [eab7b6ea3b1d6f0fc4253fa7df296bb4e40330d7] # # patch "tests/checkout_creates__MTN_log/commit_log.lua" # from [50b7346f7b34b2b15d61af4c791a43748de9f6c5] # to [236defb0b8d095aaa929e49092f6905c04eab8cb] # # patch "tests/clone_creates__MTN_log/commit_log.lua" # from [50b7346f7b34b2b15d61af4c791a43748de9f6c5] # to [df76ff8540ff6fac3a5801ccbbfef3c6fbd4cc6a] # # patch "tests/commit_default_editor/test_hooks.lua" # from [b065363352b6bbac755d7fbb152da5f65236a06d] # to [a8b8f7005a4406d01a84d05f268d30e6c979432f] # # patch "tests/commit_writes_message_back_to__MTN_log/my_hook.lua" # from [a8b4844456e4838329a7ad4ccf95f427718c1a2a] # to [2d04630f7a5715dfe91c9e2188ab9b9834701b9d] # # patch "tests/i18n_commit_messages/extra_hooks.lua" # from [d362248e82606a5ce55e6740c79608a275440438] # to [18f20cc69adabd0030cc12046147535b600aa9e8] # # patch "tests/importing_cvs_metadata/expected_log_output" # from [2a3629825db9242abe52c0107f5269d34c125494] # to [c91d730a5ffc142eff7bfa1d41a066e487fbfab3] # # patch "tests/merge_into_workspace/expected-log" # from [77915a878636ca16ee32f5385d88a7dc8bd0054a] # to [12af94f6f47e0db5c13c179228c6d164db1074e7] # # patch "tests/merge_into_workspace/expected-log-left" # from [6f396f4e143f0b58ef18131c13549622eea39cfb] # to [acf670e2a70b6e61221f7bda66ff08518902786f] # ============================================================ --- cmd_ws_commit.cc e6909c953f9df3a824f8ebb0624c5f4c59d6e9e0 +++ cmd_ws_commit.cc ca903e187f3cf617bf5ab1abbab65f36fc8b2b8b @@ -71,7 +71,7 @@ get_log_message_interactively(lua_hooks { utf8 instructions( _("Ensure the values for Author, Date and Branch are correct, then enter\n" - "a description of this change following the Changelog line. Any other\n" + "a description of this change following the ChangeLog line. Any other\n" "modifications to the lines below or to the summary of changes will\n" "cause the commit to fail.\n")); @@ -79,7 +79,12 @@ get_log_message_interactively(lua_hooks work.read_user_log(changelog); string text = changelog(); - if (!text.empty() && text[text.length()-1] != '\n') + + // ensure the changelog message ends with a newline. an empty changelog is + // replaced with a single newline so that the ChangeLog: cert line is + // produced by revision_header and there is somewhere to enter a message + + if (text.empty() || text[text.length()-1] != '\n') { text += '\n'; changelog = utf8(text, origin::user); @@ -117,18 +122,17 @@ get_log_message_interactively(lua_hooks E(raw.find(instructions()) == 0, origin::user, - F("Modifications outside of Author, Date, Branch or Changelog.\n" + F("Modifications outside of Author, Date, Branch or ChangeLog.\n" "Commit failed (missing instructions).")); if (!summary().empty()) { - // ignore the initial blank line when looking for the summary - size_t pos = raw.find(summary().substr(1)); + size_t pos = raw.find(summary()); // ignore the trailing blank line from the header as well E(pos >= instructions().length() + header().length() - 1, origin::user, - F("Modifications outside of Author, Date, Branch or Changelog.\n" + F("Modifications outside of Author, Date, Branch or ChangeLog.\n" "Commit failed (missing summary).")); raw.resize(pos); // remove the change summary } @@ -139,7 +143,7 @@ get_log_message_interactively(lua_hooks size_t pos = header().find("Author: "); E(header().substr(0, pos) == raw.substr(0, pos), origin::user, - F("Modifications outside of Author, Date, Branch or Changelog.\n" + F("Modifications outside of Author, Date, Branch or ChangeLog.\n" "Commit failed (missing revision or parent header).")); raw = raw.substr(pos); // remove the leading unchanged header lines @@ -149,13 +153,13 @@ get_log_message_interactively(lua_hooks E(lines.size() >= 4, origin::user, - F("Modifications outside of Author, Date, Branch or Changelog.\n" + F("Modifications outside of Author, Date, Branch or ChangeLog.\n" "Commit failed (missing lines).")); vector::const_iterator line = lines.begin(); E(line->find(_("Author: ")) == 0, origin::user, - F("Modifications outside of Author, Date, Branch or Changelog.\n" + F("Modifications outside of Author, Date, Branch or ChangeLog.\n" "Commit failed (missing author).")); author = trim(line->substr(8)); @@ -163,7 +167,7 @@ get_log_message_interactively(lua_hooks ++line; E(line->find(_("Date: ")) == 0, origin::user, - F("Modifications outside of Author, Date, Branch or Changelog.\n" + F("Modifications outside of Author, Date, Branch or ChangeLog.\n" "Commit failed (missing date).")); date = trim(line->substr(6)); @@ -171,7 +175,7 @@ get_log_message_interactively(lua_hooks ++line; E(line->find(_("Branch: ")) == 0, origin::user, - F("Modifications outside of Author, Date, Branch or Changelog.\n" + F("Modifications outside of Author, Date, Branch or ChangeLog.\n" "Commit failed (missing branch).")); branch = branch_name(trim(line->substr(8)), origin::user); @@ -179,10 +183,10 @@ get_log_message_interactively(lua_hooks ++line; E(*line == _("ChangeLog: "), origin::user, - F("Modifications outside of Author, Date, Branch or Changelog.\n" + F("Modifications outside of Author, Date, Branch or ChangeLog.\n" "Commit failed (missing changelog).")); - // now pointing at the optional blank line after Changelog + // now pointing at the optional blank line after ChangeLog ++line; join_lines(line, lines.end(), raw); @@ -659,7 +663,8 @@ CMD(status, "status", "", CMD_REF(inform set old_branches; get_old_branch_names(db, old_rosters, old_branches); - if (old_branches.find(app.opts.branch) == old_branches.end()) + 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(); @@ -671,6 +676,9 @@ CMD(status, "status", "", CMD_REF(inform utf8 changelog; work.read_user_log(changelog); + // ensure the changelog message ends with a newline. an empty changelog message + // is left as-is so that no ChangeLog: line is produced by revision_header. + string text = changelog(); if (!text.empty() && text[text.length()-1] != '\n') { ============================================================ --- rev_output.cc 8cb1fadbcd79aab23bf95c26aec3390f4fa950d6 +++ rev_output.cc eab7b6ea3b1d6f0fc4253fa7df296bb4e40330d7 @@ -61,7 +61,8 @@ revision_header(revision_id const rid, r for (edge_map::const_iterator i = rev.edges.begin(); i != rev.edges.end(); ++i) { revision_id parent = edge_old_revision(*i); - out << _("Parent: ") << parent << '\n'; + if (!null_id(parent)) + out << _("Parent: ") << parent << '\n'; } cert_name const author(author_cert_name); @@ -124,7 +125,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)) + if (null_id(parent)) + out << _("Changes") << "\n\n"; + else out << _("Changes against parent ") << parent << "\n\n"; // presumably a merge rev could have an empty edge if one side won @@ -138,7 +141,7 @@ revision_summary(revision_t const & rev, for (map::const_iterator i = cs.nodes_renamed.begin(); i != cs.nodes_renamed.end(); ++i) - out << _(" renamed ") << i->first + out << _(" renamed ") << i->first << '\n' << _(" to ") << i->second << '\n'; for (set::const_iterator i = cs.dirs_added.begin(); ============================================================ --- tests/checkout_creates__MTN_log/commit_log.lua 50b7346f7b34b2b15d61af4c791a43748de9f6c5 +++ tests/checkout_creates__MTN_log/commit_log.lua 236defb0b8d095aaa929e49092f6905c04eab8cb @@ -1,3 +1,3 @@ function edit_comment(user_log_file) function edit_comment(user_log_file) - return string.gsub(user_log_file, "Changelog:\n\n\n", "Changelog:\n\nLog Entry\n") + return string.gsub(user_log_file, "\nChangeLog :\n\n\n", "\nChangeLog: \n\nLog Entry\n") end ============================================================ --- tests/clone_creates__MTN_log/commit_log.lua 50b7346f7b34b2b15d61af4c791a43748de9f6c5 +++ tests/clone_creates__MTN_log/commit_log.lua df76ff8540ff6fac3a5801ccbbfef3c6fbd4cc6a @@ -1,3 +1,3 @@ function edit_comment(user_log_file) function edit_comment(user_log_file) - return string.gsub(user_log_file, "Changelog:\n\n\n", "Changelog:\n\nLog Entry\n") + return string.gsub(user_log_file, "\nChangeLog: \n\n\n", "\nChangeLog: \n\nLog Entry\n") end ============================================================ --- tests/commit_default_editor/test_hooks.lua b065363352b6bbac755d7fbb152da5f65236a06d +++ tests/commit_default_editor/test_hooks.lua a8b8f7005a4406d01a84d05f268d30e6c979432f @@ -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 a8b4844456e4838329a7ad4ccf95f427718c1a2a +++ tests/commit_writes_message_back_to__MTN_log/my_hook.lua 2d04630f7a5715dfe91c9e2188ab9b9834701b9d @@ -1,3 +1,3 @@ function edit_comment(user_log_file) function edit_comment(user_log_file) - return string.gsub(user_log_file, "Changelog:\n\n\n", "Changelog:\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 d362248e82606a5ce55e6740c79608a275440438 +++ tests/i18n_commit_messages/extra_hooks.lua 18f20cc69adabd0030cc12046147535b600aa9e8 @@ -16,11 +16,11 @@ function edit_comment(user_log_message) io.write("EDIT: BASE BAD\n") end - if string.find(user_log_message, "Changelog:\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, "Changelog:\n\n\n", "Changelog:\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, "Changelog:\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 2a3629825db9242abe52c0107f5269d34c125494 +++ tests/importing_cvs_metadata/expected_log_output c91d730a5ffc142eff7bfa1d41a066e487fbfab3 @@ -1,16 +1,14 @@ ------------------------------------------------------------------ +---------------------------------------------------------------------- Revision: f31b5f6dfeddd51ebf19cd44c4176c68bff51709 -Ancestor: Author: luigi Date: 2009-09-11T16:37:48 Branch: testbranch +ChangeLog: -Added files: - test.txt -Added directories: - . +test -ChangeLog: +Changes -test + added + added test.txt ============================================================ --- tests/merge_into_workspace/expected-log 77915a878636ca16ee32f5385d88a7dc8bd0054a +++ tests/merge_into_workspace/expected-log 12af94f6f47e0db5c13c179228c6d164db1074e7 @@ -1,44 +1,43 @@ ------------------------------------------------------------------ +---------------------------------------------------------------------- Revision: 04093de26437e634d2b43f1722e22fcc6b3804c3 -Ancestor: 87c726bb950efb3d809662b86700a8566346970d +Parent: 87c726bb950efb3d809662b86700a8566346970d Author: address@hidden Date: 2007-02-28T02:09:14 Branch: testbranch +ChangeLog: -Modified files: - testfile +blah-blah -ChangeLog: +Changes against parent 87c726bb950efb3d809662b86700a8566346970d -blah-blah + patched testfile ------------------------------------------------------------------ +---------------------------------------------------------------------- Revision: 21320a960288df775cd62b01f1b40e981f4ecd65 -Ancestor: 87c726bb950efb3d809662b86700a8566346970d +Parent: 87c726bb950efb3d809662b86700a8566346970d Author: address@hidden Date: 2007-02-28T02:09:13 Branch: testbranch +ChangeLog: -Modified files: - testfile +blah-blah -ChangeLog: +Changes against parent 87c726bb950efb3d809662b86700a8566346970d -blah-blah + patched testfile ------------------------------------------------------------------ +---------------------------------------------------------------------- Revision: 87c726bb950efb3d809662b86700a8566346970d -Ancestor: Author: address@hidden Date: 2007-02-28T02:09:12 Branch: testbranch +ChangeLog: -Added files: - otherfile testfile -Added directories: - . +blah-blah -ChangeLog: +Changes -blah-blah + added + added otherfile + added testfile ============================================================ --- tests/merge_into_workspace/expected-log-left 6f396f4e143f0b58ef18131c13549622eea39cfb +++ tests/merge_into_workspace/expected-log-left acf670e2a70b6e61221f7bda66ff08518902786f @@ -1,30 +1,29 @@ ------------------------------------------------------------------ +---------------------------------------------------------------------- Revision: 21320a960288df775cd62b01f1b40e981f4ecd65 -Ancestor: 87c726bb950efb3d809662b86700a8566346970d +Parent: 87c726bb950efb3d809662b86700a8566346970d Author: address@hidden Date: 2007-02-28T02:11:20 Branch: testbranch +ChangeLog: -Modified files: - testfile +blah-blah -ChangeLog: +Changes against parent 87c726bb950efb3d809662b86700a8566346970d -blah-blah + patched testfile ------------------------------------------------------------------ +---------------------------------------------------------------------- Revision: 87c726bb950efb3d809662b86700a8566346970d -Ancestor: Author: address@hidden Date: 2007-02-28T02:11:19 Branch: testbranch +ChangeLog: -Added files: - otherfile testfile -Added directories: - . +blah-blah -ChangeLog: +Changes -blah-blah + added + added otherfile + added testfile