# # # patch "cmd_ws_commit.cc" # from [d877a94843bcbee880eb45d0aab4ebd3f6cdb794] # to [0aa51a85aef50271b6755e53723ac9e94e49d189] # # patch "rev_output.cc" # from [d8d29a05cb917058ef7b7188a8544ff5cd45cf26] # to [d3979e2e706aaa0fee3947ae424b9e9595460fed] # # patch "rev_output.hh" # from [930cdf038dc5094b7e9f51b159502bea4c97a39c] # to [a81f8b7801fe5adceb0b988fe79f9af7dc85ae8c] # ============================================================ --- cmd_ws_commit.cc d877a94843bcbee880eb45d0aab4ebd3f6cdb794 +++ cmd_ws_commit.cc 0aa51a85aef50271b6755e53723ac9e94e49d189 @@ -67,7 +67,6 @@ 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, - bool const branch_changed, utf8 & log_message) { external instructions( @@ -80,7 +79,7 @@ get_log_message_interactively(lua_hooks utf8 message; utf8 summary; - revision_header(rid, rev, author, date, branch, branch_changed, header); + revision_header(rid, rev, author, date, branch, header); work.read_user_log(message); revision_summary(rev, summary); @@ -108,9 +107,9 @@ 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 "Changes against + // between the "ChangeLog: " line from the header and the "Changes against // parent ..." line from the summary is where they should be adding - // lines. Ideally, there is a blank line following "Changelog:" + // lines. Ideally, there is a blank line following "ChangeLog:" // (preceeding the changelog message) and another blank line preceeding // "Changes against parent ..." (following the changelog message) but both // of these are optional. @@ -174,15 +173,10 @@ get_log_message_interactively(lua_hooks F("Modifications outside of Author, Date, Branch or Changelog.\n" "Commit failed (missing branch).")); - // FIXME: this suffix and the associated length calculations are bad - if (branch_changed && line->rfind(_("(changed)")) == line->length() - 9) - branch = branch_name(trim(line->substr(8, line->length() - 17)), - origin::user); - else - branch = branch_name(trim(line->substr(8)), origin::user); + branch = branch_name(trim(line->substr(8)), origin::user); ++line; - E(*line == _("Changelog:"), + E(*line == _("ChangeLog: "), origin::user, F("Modifications outside of Author, Date, Branch or Changelog.\n" "Commit failed (missing changelog).")); @@ -668,11 +662,16 @@ CMD(status, "status", "", CMD_REF(inform set old_branches; get_old_branch_names(db, old_rosters, old_branches); - bool branch_changed = - old_branches.find(app.opts.branch) == old_branches.end(); + if (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"; + } - revision_header(rid, rev, author, date_t::now(), - app.opts.branch, branch_changed, header); + revision_header(rid, rev, author, date_t::now(), app.opts.branch, header); work.read_user_log(message); @@ -695,7 +694,8 @@ CMD(status, "status", "", CMD_REF(inform cout << header_external << message_external - << summary_external; + << summary_external + << '\n'; } CMD(checkout, "checkout", "co", CMD_REF(tree), N_("[DIRECTORY]"), @@ -1245,16 +1245,10 @@ CMD(commit, "commit", "ci", CMD_REF(work if (!log_message_given) { - set old_branches; - get_old_branch_names(db, old_rosters, old_branches); - bool branch_changed = - old_branches.find(app.opts.branch) == old_branches.end(); - // This call handles _MTN/log. get_log_message_interactively(app.lua, work, restricted_rev_id, restricted_rev, author, date, app.opts.branch, - branch_changed, log_message); // We only check for empty log messages when the user entered them ============================================================ --- rev_output.cc d8d29a05cb917058ef7b7188a8544ff5cd45cf26 +++ rev_output.cc d3979e2e706aaa0fee3947ae424b9e9595460fed @@ -24,14 +24,13 @@ void using std::ostringstream; void -revision_header(revision_id rid, revision_t const & rev, string const & author, - date_t const date, branch_name const & branch, - bool const branch_changed, utf8 & header) +revision_header(revision_id const rid, revision_t const & rev, + string const & author, date_t const date, + branch_name const & branch, utf8 & header) { ostringstream out; int const width = 70; - // FIXME bad suffix out << string(width, '-') << '\n' << _("Revision: ") << rid << _(" (uncommitted)") << '\n'; @@ -42,20 +41,10 @@ revision_header(revision_id rid, revisio } out << _("Author: ") << author << '\n' - << _("Date: ") << date << '\n'; + << _("Date: ") << date << '\n' + << _("Branch: ") << branch << '\n' + << _("ChangeLog: ") << "\n\n"; - if (branch_changed) - { - // FIXME bad suffix - int space = width - branch().length() - 8 - 10; - if (space < 0) space = 0; - out << _("Branch: ") << branch << string(space, ' ') << _(" (changed)") << '\n'; - } - else - out << _("Branch: ") << branch << '\n'; - - out << _("Changelog:") << "\n\n"; - header = utf8(out.str(), origin::internal); } ============================================================ --- rev_output.hh 930cdf038dc5094b7e9f51b159502bea4c97a39c +++ rev_output.hh a81f8b7801fe5adceb0b988fe79f9af7dc85ae8c @@ -16,9 +16,9 @@ void struct date_t; void -revision_header(revision_id rid, revision_t const & rev, std::string const & author, - date_t const date, branch_name const & branch, - bool const branch_changed, utf8 & header); +revision_header(revision_id const rid, revision_t const & rev, + std::string const & author, date_t const date, + branch_name const & branch, utf8 & header); void revision_summary(revision_t const & rev, utf8 & summary);