# # # patch "cmd_merging.cc" # from [b9e3e1579bd3e0ea69695b33b40f3244a18739fa] # to [8294caa3d6c1d7f2c071cc179b829fa03758d519] # # patch "project.cc" # from [353d9487fc43a25ea9b5ed609493d0837739c5fd] # to [4cf6ded39104d9cc951b6564c95c4a515a796c82] # ============================================================ --- cmd_merging.cc b9e3e1579bd3e0ea69695b33b40f3244a18739fa +++ cmd_merging.cc 8294caa3d6c1d7f2c071cc179b829fa03758d519 @@ -89,19 +89,13 @@ static bool } static bool -pick_branch_for_update(options & opts, database & db, revision_id chosen_rid) +pick_branch_for_update(options & opts, project_set & projects, revision_id chosen_rid) { bool switched_branch = false; // figure out which branches the target is in - vector< revision > certs; - db.get_revision_certs(chosen_rid, branch_cert_name, certs); - erase_bogus_certs(db, certs); - set< branch_name > branches; - for (vector< revision >::const_iterator i = certs.begin(); - i != certs.end(); i++) - branches.insert(branch_name(i->inner().value())); + projects.get_revision_branches(chosen_rid, branches); if (branches.find(opts.branchname) != branches.end()) { @@ -169,6 +163,7 @@ CMD(update, "update", "", CMD_REF(worksp // Figure out where we're going N(!app.opts.branchname().empty(), F("cannot determine branch for update")); + MM(app.opts.branchname); revision_id chosen_rid; if (app.opts.revision_selectors.size() == 0) @@ -220,7 +215,7 @@ CMD(update, "update", "", CMD_REF(worksp // Fiddle around with branches, in an attempt to guess what the user // wants. - bool switched_branch = pick_branch_for_update(app.opts, db, chosen_rid); + bool switched_branch = pick_branch_for_update(app.opts, projects, chosen_rid); if (switched_branch) P(F("switching to branch %s") % app.opts.branchname()); ============================================================ --- project.cc 353d9487fc43a25ea9b5ed609493d0837739c5fd +++ project.cc 4cf6ded39104d9cc951b6564c95c4a515a796c82 @@ -618,6 +618,7 @@ project_set::get_project_of_branch(branc project_t & project_set::get_project_of_branch(branch_name const & branch) { + MM(branch); project_t * const project = maybe_get_project_of_branch(branch); I(project != NULL); return *project;