# # # patch "cmd_ws_commit.cc" # from [c526804d60744f302780eaf3fd89663836591710] # to [8321ee742a65e2ebaf58c328bdf6bdda11c8f21c] # ============================================================ --- cmd_ws_commit.cc c526804d60744f302780eaf3fd89663836591710 +++ cmd_ws_commit.cc 8321ee742a65e2ebaf58c328bdf6bdda11c8f21c @@ -984,10 +984,12 @@ CMD_AUTOMATE(drop_attribute, N_("PATH [K app.work.update_any_attrs(); } -static void -commit(app_state & app, commands::command_id const & execid, - args_vector const & args, std::ostream & output, - bool automate) +CMD(commit, "commit", "ci", CMD_REF(workspace), N_("[PATH]..."), + N_("Commits workspace changes to the database"), + "", + options::opts::branch | options::opts::message | options::opts::msgfile + | options::opts::date | options::opts::author | options::opts::depth + | options::opts::exclude) { utf8 log_message(""); bool log_message_given; @@ -1045,10 +1047,7 @@ commit(app_state & app, commands::comman app.opts.branchname = branchname; } - if (automate) - output << app.opts.branchname << "\n"; - else - P(F("beginning commit on branch '%s'") % app.opts.branchname); + P(F("beginning commit on branch '%s'") % app.opts.branchname); L(FL("new manifest '%s'\n" "new revision '%s'\n") @@ -1197,10 +1196,7 @@ commit(app_state & app, commands::comman // small race condition here... app.work.put_work_rev(remaining); - if (automate) - output << restricted_rev_id << "\n"; - else - P(F("committed revision %s") % restricted_rev_id); + P(F("committed revision %s") % restricted_rev_id); app.work.blank_user_log(); @@ -1236,29 +1232,6 @@ commit(app_state & app, commands::comman } } -CMD(commit, "commit", "ci", CMD_REF(workspace), N_("[PATH]..."), - N_("Commits workspace changes to the database"), - "", - options::opts::branch | options::opts::message | options::opts::msgfile - | options::opts::date | options::opts::author | options::opts::depth - | options::opts::exclude) -{ - commit(app, execid, args, std::cout, false); -} - -// outputs the branch followed a newline followed by the new revision id: -// net.venge.monotone\n -// d2510c2eca90359794ba34989314f97a623566bc\n -CMD_AUTOMATE(commit, - N_("[PATH]..."), - N_("Commits workspace changes to the database"), "", - options::opts::branch | options::opts::message | options::opts::msgfile - | options::opts::date | options::opts::author | options::opts::depth - | options::opts::exclude) -{ - commit(app, execid, args, output, true); -} - CMD_NO_WORKSPACE(setup, "setup", "", CMD_REF(tree), N_("[DIRECTORY]"), N_("Sets up a new workspace directory"), N_("If no directory is specified, uses the current directory."),