# # # patch "automate.cc" # from [ac1ee1778db44574934d4f33ecc6d2d4314830bd] # to [7fe1988316269eb34d1ca1e2a08f99df2a1ceb92] # # patch "cert.cc" # from [b3dcf32e9aef5757a17afc8ec113a41cb428b861] # to [998ff85450d2c9459428f159da44f88d0de1524d] # # patch "cmd_key_cert.cc" # from [a6a341676c5f588f994d9a2e1743c91dcdd2ad4b] # to [ad6d77c2c604e15b31c69d0bd82e1efbc360a167] # # patch "cmd_merging.cc" # from [1dac535deebfa500d093cf57494e620c65f6f2c6] # to [a644ca4f6e45e2885224b6565835e81a76d7e729] # # patch "cmd_netsync.cc" # from [6fe2e56d33f4c4e6566bb4c993ae0ec3871a8365] # to [ec8f8dad70788df8364337edbf02ef6d6c7080e4] # # patch "cmd_othervcs.cc" # from [ffef05703295b5f6ae6b5860cb83a7a960b74b03] # to [7ed7df9b821655a86a99895efd435e0920628355] # # patch "cmd_ws_commit.cc" # from [d5b67e56feba5368cc5c7bfdd90d510e979c4661] # to [55bf3a32074c86e68d93fc43bdfaf217dcf61476] # # patch "keys.cc" # from [bcd0aee2b93c4e03b4eea9e2f227a106bc970664] # to [aeb9579d74ab428a62537612e878d2edcbd2345c] # # patch "options_list.hh" # from [49add23d26b58781c71b9de4e3a2258e1fc5866c] # to [378027f37a6be67813e219ef02b3450d70dee2e4] # # patch "selectors.cc" # from [0379e566dbf2b7deaf7f209218f5d4cd0d148517] # to [d82ef3e1ce41c686b07e354e4ecdbbb3a0dada2e] # # patch "work.cc" # from [481ece16aab1f54d77ae8816bd39ba8c7e79c801] # to [8639fa3a282cb2ce24dd2b582d9be4ad833b43ac] # ============================================================ --- automate.cc ac1ee1778db44574934d4f33ecc6d2d4314830bd +++ automate.cc 7fe1988316269eb34d1ca1e2a08f99df2a1ceb92 @@ -91,7 +91,7 @@ CMD_AUTOMATE(heads, N_("[BRANCH]"), else { workspace::require_workspace(F("with no argument, this command prints the heads of the workspace's branch")); - branch = app.opts.branchname; + branch = app.opts.branch; } set heads; ============================================================ --- cert.cc b3dcf32e9aef5757a17afc8ec113a41cb428b861 +++ cert.cc 998ff85450d2c9459428f159da44f88d0de1524d @@ -392,8 +392,8 @@ guess_branch(options & opts, project_t & guess_branch(options & opts, project_t & project, revision_id const & ident, branch_name & branchname) { - if (opts.branch_given && !opts.branchname().empty()) - branchname = opts.branchname; + if (opts.branch_given && !opts.branch().empty()) + branchname = opts.branch; else { E(!ident.inner()().empty(), origin::user, @@ -424,7 +424,7 @@ guess_branch(options & opts, project_t & { branch_name branchname; guess_branch(opts, project, ident, branchname); - opts.branchname = branchname; + opts.branch = branchname; } void ============================================================ --- cmd_key_cert.cc a6a341676c5f588f994d9a2e1743c91dcdd2ad4b +++ cmd_key_cert.cc ad6d77c2c604e15b31c69d0bd82e1efbc360a167 @@ -299,11 +299,11 @@ CMD(approve, "approve", "", CMD_REF(revi revision_id r; complete(app.opts, app.lua, project, idx(args, 0)(), r); guess_branch(app.opts, project, r); - E(app.opts.branchname() != "", origin::user, + E(!app.opts.branch().empty(), origin::user, F("need --branch argument for approval")); cache_user_key(app.opts, app.lua, db, keys); - project.put_revision_in_branch(keys, r, app.opts.branchname); + project.put_revision_in_branch(keys, r, app.opts.branch); } CMD(suspend, "suspend", "", CMD_REF(review), N_("REVISION"), @@ -321,11 +321,11 @@ CMD(suspend, "suspend", "", CMD_REF(revi revision_id r; complete(app.opts, app.lua, project, idx(args, 0)(), r); guess_branch(app.opts, project, r); - E(app.opts.branchname() != "", origin::user, + E(!app.opts.branch().empty(), origin::user, F("need --branch argument to suspend")); cache_user_key(app.opts, app.lua, db, keys); - project.suspend_revision_in_branch(keys, r, app.opts.branchname); + project.suspend_revision_in_branch(keys, r, app.opts.branch); } CMD(comment, "comment", "", CMD_REF(review), N_("REVISION [COMMENT]"), ============================================================ --- cmd_merging.cc 1dac535deebfa500d093cf57494e620c65f6f2c6 +++ cmd_merging.cc a644ca4f6e45e2885224b6565835e81a76d7e729 @@ -103,9 +103,9 @@ pick_branch_for_update(options & opts, d i != certs.end(); i++) branches.insert(typecast_vocab(i->inner().value)); - if (branches.find(opts.branchname) != branches.end()) + if (branches.find(opts.branch) != branches.end()) { - L(FL("using existing branch %s") % opts.branchname()); + L(FL("using existing branch %s") % opts.branch()); } else { @@ -124,7 +124,7 @@ pick_branch_for_update(options & opts, d else if (branches.size() == 1) { // one non-matching, inform and update - opts.branchname = *(branches.begin()); + opts.branch = *(branches.begin()); switched_branch = true; } else @@ -132,7 +132,7 @@ pick_branch_for_update(options & opts, d I(branches.empty()); W(F("target revision not in any branch\n" "next commit will use branch %s") - % opts.branchname); + % opts.branch); } } return switched_branch; @@ -168,22 +168,22 @@ CMD(update, "update", "", CMD_REF(worksp F("this workspace is a new project; cannot update")); // Figure out where we're going - E(!app.opts.branchname().empty(), origin::user, + E(!app.opts.branch().empty(), origin::user, F("cannot determine branch for update")); revision_id chosen_rid; if (app.opts.revision_selectors.empty()) { - P(F("updating along branch '%s'") % app.opts.branchname); + P(F("updating along branch '%s'") % app.opts.branch); set candidates; pick_update_candidates(app.lua, project, candidates, old_rid, - app.opts.branchname, + app.opts.branch, app.opts.ignore_suspend_certs); E(!candidates.empty(), origin::user, F("your request matches no descendents of the current revision\n" "in fact, it doesn't even match the current revision\n" "maybe you want something like --revision=h:%s") - % app.opts.branchname); + % app.opts.branch); if (candidates.size() != 1) { P(F("multiple update candidates:")); @@ -207,7 +207,7 @@ CMD(update, "update", "", CMD_REF(worksp // because when you are at one of several heads, and you hit update, you // want to know that merging would let you update further. notify_if_multiple_heads(project, - app.opts.branchname, app.opts.ignore_suspend_certs); + app.opts.branch, app.opts.ignore_suspend_certs); if (old_rid == chosen_rid) { @@ -224,7 +224,7 @@ CMD(update, "update", "", CMD_REF(worksp // wants. bool switched_branch = pick_branch_for_update(app.opts, db, chosen_rid); if (switched_branch) - P(F("switching to branch %s") % app.opts.branchname()); + P(F("switching to branch %s") % app.opts.branch()); // Okay, we have a target, we have a branch, let's do this merge! @@ -306,7 +306,7 @@ CMD(update, "update", "", CMD_REF(worksp work.set_options(app.opts, true); if (switched_branch) - P(F("switched branch; next commit will use branch %s") % app.opts.branchname()); + P(F("switched branch; next commit will use branch %s") % app.opts.branch()); P(F("updated to base revision %s") % chosen_rid); } @@ -336,14 +336,14 @@ merge_two(options & opts, lua_hooks & lu bool log_message_given; size_t fieldwidth = max(caller.size() + strlen(" of '"), strlen("and '")); - if (branch != opts.branchname) + if (branch != opts.branch) fieldwidth = max(fieldwidth, strlen("to branch '")); log << setw(fieldwidth - strlen(" of '")) << caller << " of '" << left << "'\n" << setw(fieldwidth) << "and '" << right << "'\n"; - if (branch != opts.branchname) + if (branch != opts.branch) log << setw(fieldwidth) << "to branch '" << branch << "'\n"; process_commit_message_args(opts, log_message_given, log_message, @@ -442,23 +442,23 @@ CMD(merge, "merge", "", CMD_REF(tree), " if (!args.empty()) throw usage(execid); - E(app.opts.branchname() != "", origin::user, + E(!app.opts.branch().empty(), origin::user, F("please specify a branch, with --branch=BRANCH")); set heads; - project.get_branch_heads(app.opts.branchname, heads, + project.get_branch_heads(app.opts.branch, heads, app.opts.ignore_suspend_certs); E(!heads.empty(), origin::user, - F("branch '%s' is empty") % app.opts.branchname); + F("branch '%s' is empty") % app.opts.branch); if (heads.size() == 1) { - P(F("branch '%s' is already merged") % app.opts.branchname); + P(F("branch '%s' is already merged") % app.opts.branch); return; } P(FP("%d head on branch '%s'", "%d heads on branch '%s'", heads.size()) - % heads.size() % app.opts.branchname); + % heads.size() % app.opts.branch); // avoid failure after lots of work cache_user_key(app.opts, app.lua, db, keys); @@ -491,16 +491,16 @@ CMD(merge, "merge", "", CMD_REF(tree), " revpair p = find_heads_to_merge(db, heads); merge_two(app.opts, app.lua, project, keys, - p.first, p.second, app.opts.branchname, string("merge"), + p.first, p.second, app.opts.branch, string("merge"), std::cout, false); - project.get_branch_heads(app.opts.branchname, heads, + project.get_branch_heads(app.opts.branch, heads, app.opts.ignore_suspend_certs); pass++; } if (heads.size() > 1) - P(F("note: branch '%s' still has %d heads; run merge again") % app.opts.branchname % heads.size()); + P(F("note: branch '%s' still has %d heads; run merge again") % app.opts.branch % heads.size()); P(F("note: your workspaces have not been updated")); } @@ -1010,15 +1010,15 @@ static void get_conflicts_rids(args_vect if (args.empty()) { // get ids from heads - E(app.opts.branchname() != "", origin::user, + E(!app.opts.branch().empty(), origin::user, F("please specify a branch, with --branch=BRANCH")); set heads; - project.get_branch_heads(app.opts.branchname, heads, + project.get_branch_heads(app.opts.branch, heads, app.opts.ignore_suspend_certs); E(heads.size() >= 2, origin::user, - F("branch '%s' has only 1 head; must be at least 2 for conflicts") % app.opts.branchname); + F("branch '%s' has only 1 head; must be at least 2 for conflicts") % app.opts.branch); revpair p = find_heads_to_merge (db, heads); left_rid = p.first; @@ -1341,21 +1341,21 @@ CMD(heads, "heads", "", CMD_REF(tree), " if (!args.empty()) throw usage(execid); - E(app.opts.branchname() != "", origin::user, + E(!app.opts.branch().empty(), origin::user, F("please specify a branch, with --branch=BRANCH")); database db(app); project_t project(db); - project.get_branch_heads(app.opts.branchname, heads, + project.get_branch_heads(app.opts.branch, heads, app.opts.ignore_suspend_certs); if (heads.empty()) - P(F("branch '%s' is empty") % app.opts.branchname); + P(F("branch '%s' is empty") % app.opts.branch); else if (heads.size() == 1) - P(F("branch '%s' is currently merged:") % app.opts.branchname); + P(F("branch '%s' is currently merged:") % app.opts.branch); else - P(F("branch '%s' is currently unmerged:") % app.opts.branchname); + P(F("branch '%s' is currently unmerged:") % app.opts.branch); for (set::const_iterator i = heads.begin(); i != heads.end(); ++i) ============================================================ --- cmd_netsync.cc 6fe2e56d33f4c4e6566bb4c993ae0ec3871a8365 +++ cmd_netsync.cc ec8f8dad70788df8364337edbf02ef6d6c7080e4 @@ -374,12 +374,12 @@ CMD(clone, "clone", "", CMD_REF(network) / bookkeeping_root_component / ws_internal_db_file_name); - // this is actually stupid, but app.opts.branchname must be set here + // this is actually stupid, but app.opts.branch must be set here // otherwise it will not be written into _MTN/options, in case // a revision is chosen which has multiple branch certs - app.opts.branchname = branchname; + app.opts.branch = branchname; workspace::create_workspace(app.opts, app.lua, workspace_dir); - app.opts.branchname = branch_name(); + app.opts.branch = branch_name(); database db(app); if (get_path_status(db.get_filename()) == path::nonexistent) ============================================================ --- cmd_othervcs.cc ffef05703295b5f6ae6b5860cb83a7a960b74b03 +++ cmd_othervcs.cc 7ed7df9b821655a86a99895efd435e0920628355 @@ -45,7 +45,7 @@ CMD(cvs_import, "cvs_import", "", CMD_RE if (args.size() != 1) throw usage(execid); - E(app.opts.branchname() != "", origin::user, + E(!app.opts.branch().empty(), origin::user, F("need base --branch argument for importing")); system_path cvsroot(idx(args, 0)(), origin::user); @@ -58,7 +58,7 @@ CMD(cvs_import, "cvs_import", "", CMD_RE // amount of work cache_user_key(app.opts, app.lua, db, keys); - import_cvs_repo(project, keys, cvsroot, app.opts.branchname); + import_cvs_repo(project, keys, cvsroot, app.opts.branch); } ============================================================ --- cmd_ws_commit.cc d5b67e56feba5368cc5c7bfdd90d510e979c4661 +++ cmd_ws_commit.cc 55bf3a32074c86e68d93fc43bdfaf217dcf61476 @@ -367,7 +367,7 @@ CMD(disapprove, "disapprove", "", CMD_RE % r % rev.edges.size()); guess_branch(app.opts, project, r); - E(app.opts.branchname() != "", origin::user, + E(!app.opts.branch().empty(), origin::user, F("need --branch argument for disapproval")); process_commit_message_args(app.opts, log_message_given, log_message, @@ -399,7 +399,7 @@ CMD(disapprove, "disapprove", "", CMD_RE db.put_revision(inv_id, rdat); project.put_standard_certs_from_options(app.opts, app.lua, keys, - inv_id, app.opts.branchname, + inv_id, app.opts.branch, log_message); guard.commit(); } @@ -595,7 +595,7 @@ CMD(status, "status", "", CMD_REF(inform make_restricted_revision(old_rosters, new_roster, mask, rev); utf8 summary; - revision_summary(rev, app.opts.branchname, summary); + revision_summary(rev, app.opts.branch, summary); external summary_external; utf8_to_system_best_effort(summary, summary_external); cout << summary_external; @@ -621,23 +621,23 @@ CMD(checkout, "checkout", "co", CMD_REF( if (app.opts.revision_selectors.empty()) { // use branch head revision - E(!app.opts.branchname().empty(), origin::user, + E(!app.opts.branch().empty(), origin::user, F("use --revision or --branch to specify what to checkout")); set heads; - project.get_branch_heads(app.opts.branchname, heads, + project.get_branch_heads(app.opts.branch, heads, app.opts.ignore_suspend_certs); E(!heads.empty(), origin::user, - F("branch '%s' is empty") % app.opts.branchname); + F("branch '%s' is empty") % app.opts.branch); if (heads.size() > 1) { - P(F("branch %s has multiple heads:") % app.opts.branchname); + P(F("branch %s has multiple heads:") % app.opts.branch); for (set::const_iterator i = heads.begin(); i != heads.end(); ++i) P(i18n_format(" %s") % describe_revision(project, *i)); P(F("choose one with '%s checkout -r'") % prog_name); E(false, origin::user, - F("branch %s has multiple heads") % app.opts.branchname); + F("branch %s has multiple heads") % app.opts.branch); } revid = *(heads.begin()); } @@ -648,12 +648,12 @@ CMD(checkout, "checkout", "co", CMD_REF( guess_branch(app.opts, project, revid); - I(!app.opts.branchname().empty()); + I(!app.opts.branch().empty()); - E(project.revision_is_in_branch(revid, app.opts.branchname), + E(project.revision_is_in_branch(revid, app.opts.branch), origin::user, F("revision %s is not a member of branch %s") - % revid % app.opts.branchname); + % revid % app.opts.branch); } // we do this part of the checking down here, because it is legitimate to @@ -668,9 +668,9 @@ CMD(checkout, "checkout", "co", CMD_REF( if (args.empty()) { // No checkout dir specified, use branch name for dir. - E(!app.opts.branchname().empty(), origin::user, + E(!app.opts.branch().empty(), origin::user, F("you must specify a destination directory")); - dir = system_path(app.opts.branchname(), origin::user); + dir = system_path(app.opts.branch(), origin::user); } else { @@ -1121,7 +1121,7 @@ CMD(commit, "commit", "ci", CMD_REF(work // We need the 'if' because guess_branch will try to override any branch // picked up from _MTN/options. - if (app.opts.branchname().empty()) + if (app.opts.branch().empty()) { branch_name branchname, bn_candidate; for (edge_map::iterator i = restricted_rev.edges.begin(); @@ -1139,10 +1139,10 @@ CMD(commit, "commit", "ci", CMD_REF(work branchname = bn_candidate; } - app.opts.branchname = branchname; + app.opts.branch = branchname; } - P(F("beginning commit on branch '%s'") % app.opts.branchname); + P(F("beginning commit on branch '%s'") % app.opts.branch); if (global_sanity.debug_p()) { @@ -1164,7 +1164,7 @@ CMD(commit, "commit", "ci", CMD_REF(work { // This call handles _MTN/log. get_log_message_interactively(app.lua, work, restricted_rev, - app.opts.branchname, log_message); + app.opts.branch, log_message); // We only check for empty log messages when the user entered them // interactively. Consensus was that if someone wanted to explicitly @@ -1191,7 +1191,7 @@ CMD(commit, "commit", "ci", CMD_REF(work revision_data new_rev; write_revision(restricted_rev, new_rev); - app.lua.hook_validate_commit_message(log_message, new_rev, app.opts.branchname, + app.lua.hook_validate_commit_message(log_message, new_rev, app.opts.branch, message_validated, reason); E(message_validated, origin::user, F("log message rejected by hook: %s") % reason); @@ -1200,7 +1200,7 @@ CMD(commit, "commit", "ci", CMD_REF(work // for the divergence check, below set heads; - project.get_branch_heads(app.opts.branchname, heads, + project.get_branch_heads(app.opts.branch, heads, app.opts.ignore_suspend_certs); unsigned int old_head_size = heads.size(); @@ -1295,7 +1295,7 @@ CMD(commit, "commit", "ci", CMD_REF(work project.put_standard_certs_from_options(app.opts, app.lua, keys, restricted_rev_id, - app.opts.branchname, + app.opts.branch, log_message); guard.commit(); } @@ -1314,7 +1314,7 @@ CMD(commit, "commit", "ci", CMD_REF(work work.blank_user_log(); - project.get_branch_heads(app.opts.branchname, heads, + project.get_branch_heads(app.opts.branch, heads, app.opts.ignore_suspend_certs); if (heads.size() > old_head_size && old_head_size > 0) { P(F("note: this revision creates divergence\n" @@ -1351,7 +1351,7 @@ CMD_NO_WORKSPACE(setup, "setup", "", CMD { if (args.size() > 1) throw usage(execid); - E(!app.opts.branchname().empty(), origin::user, + E(!app.opts.branch().empty(), origin::user, F("need --branch argument for setup")); database db(app); @@ -1395,31 +1395,31 @@ CMD_NO_WORKSPACE(import, "import", "", C guess_branch(app.opts, project, ident); - I(!app.opts.branchname().empty()); + I(!app.opts.branch().empty()); - E(project.revision_is_in_branch(ident, app.opts.branchname), + E(project.revision_is_in_branch(ident, app.opts.branch), origin::user, F("revision %s is not a member of branch %s") - % ident % app.opts.branchname); + % ident % app.opts.branch); } else { // use branch head revision - E(!app.opts.branchname().empty(), origin::user, + E(!app.opts.branch().empty(), origin::user, F("use --revision or --branch to specify the parent revision for the import")); set heads; - project.get_branch_heads(app.opts.branchname, heads, + project.get_branch_heads(app.opts.branch, heads, app.opts.ignore_suspend_certs); if (heads.size() > 1) { - P(F("branch %s has multiple heads:") % app.opts.branchname); + P(F("branch %s has multiple heads:") % app.opts.branch); for (set::const_iterator i = heads.begin(); i != heads.end(); ++i) P(i18n_format(" %s") % describe_revision(project, *i)); P(F("choose one with '%s import -r'") % prog_name); E(false, origin::user, - F("branch %s has multiple heads") % app.opts.branchname); + F("branch %s has multiple heads") % app.opts.branch); } if (!heads.empty()) ident = *(heads.begin()); ============================================================ --- keys.cc bcd0aee2b93c4e03b4eea9e2f227a106bc970664 +++ keys.cc aeb9579d74ab428a62537612e878d2edcbd2345c @@ -65,7 +65,7 @@ get_user_key(options const & opts, lua_h if (!opts.signing_key().empty()) key = opts.signing_key; - else if (lua.hook_get_branch_key(opts.branchname, key)) + else if (lua.hook_get_branch_key(opts.branch, key)) ; // the lua hook sets the key else { ============================================================ --- options_list.hh 49add23d26b58781c71b9de4e3a2258e1fc5866c +++ options_list.hh 378027f37a6be67813e219ef02b3450d70dee2e4 @@ -119,12 +119,11 @@ OPTION(bind_opts, bind_stdio, false, "st } #endif -OPTVAR(branch, branch_name, branchname, ) -OPTION(branch, branch, true, "branch,b", +OPT(branch, "branch,b", branch_name, , gettext_noop("select branch cert for operation")) #ifdef option_bodies { - branchname = branch_name(arg, origin::user); + branch = branch_name(arg, origin::user); } #endif ============================================================ --- selectors.cc 0379e566dbf2b7deaf7f209218f5d4cd0d148517 +++ selectors.cc d82ef3e1ce41c686b07e354e4ecdbbb3a0dada2e @@ -163,7 +163,7 @@ decode_selector(project_t & project, : F("the empty head selector h: refers to " "the head of the current branch"); workspace::require_workspace(msg); - sel = opts.branchname(); + sel = opts.branch(); } break; ============================================================ --- work.cc 481ece16aab1f54d77ae8816bd39ba8c7e79c801 +++ work.cc 8639fa3a282cb2ce24dd2b582d9be4ad833b43ac @@ -467,13 +467,13 @@ workspace::get_options(options & opts) opts.key_dir_given = true; } - if (opts.branchname().empty() && !workspace_branch().empty()) + if (opts.branch().empty() && !workspace_branch().empty()) { - opts.branchname = workspace_branch; + opts.branch = workspace_branch; branch_is_sticky = true; } - L(FL("branch name is '%s'") % opts.branchname); + L(FL("branch name is '%s'") % opts.branch); if (!opts.key_given) opts.signing_key = workspace_key; @@ -526,8 +526,8 @@ workspace::set_options(options const & o get_path_status(opts.key_dir.as_internal()) == path::directory) workspace_keydir = opts.key_dir; if ((branch_is_sticky || workspace::branch_is_sticky) - && !opts.branchname().empty()) - workspace_branch = opts.branchname; + && !opts.branch().empty()) + workspace_branch = opts.branch; if (opts.key_given) workspace_key = opts.signing_key;