# # # patch "README.encapsulation" # from [1fdd5795011a09dd0b09a49df82f57a4f4a786f4] # to [6abfc727291faeeba7b5a9765fc0d532c1b2ee45] # # patch "cert.cc" # from [aa9c547033ac63c45efd6e82a72643fe90398dc3] # to [b0908ee81de56cff78f0854d43c65637a8b74b7e] # # patch "cert.hh" # from [587d7fa395ee45b3731447ab9eeb1721a2278cce] # to [2700aa9422c6d9783cb252df855a39cb39bba03a] # # patch "cmd.hh" # from [13b36cff4d760ca85548124e0ff51aaddd2d2c7e] # to [12b3632e47447c7749697a8bbb36a7d0b08af268] # # patch "cmd_db.cc" # from [eee478f3a505c9630983790d6b720bf9f1bd6a94] # to [00600193ed44613bcc5a0b56ecfbea64499f80cf] # # patch "cmd_diff_log.cc" # from [6212181d5e3d7b90182b1253cf5a7006d8256af2] # to [eae3ce2b4f7e22b659b211efb893aec61d0b2647] # # patch "cmd_files.cc" # from [54fe77df26911485cf7af092e61cb565a6ade369] # to [d598d5629971c8bb3d857f38de94320dec8c2ac7] # # patch "cmd_key_cert.cc" # from [76dd54eb9659b916c562a30fbe6384c1ae2e2edc] # to [346ceb2fb46108e32db112dc6310ad812aa9a7d4] # # patch "cmd_list.cc" # from [99af2b16b3355b6eb57a02299d31cc88285265a8] # to [16049fb28f5a21a8d1e15afbabbd11d7d5874a30] # # patch "cmd_merging.cc" # from [60d92e3c90b4ca18c0460603fbef81fcc088a02a] # to [0fa3eb83d02680c4be7da772663b8c7b8ecfb481] # # patch "cmd_netsync.cc" # from [070e7f74fe5b02d74df01d0d9a4979dcb1282be7] # to [17573664fcdf96f623a7990da0de0e9cdbfaed43] # # patch "cmd_ws_commit.cc" # from [2211926e7f74fc2957d46014cf7020e681c09a6f] # to [65bb925c7d7345dc7f7769f67a0f2f01b3b2bca8] # # patch "commands.cc" # from [b914eda21abeb6c043a8d05f10822fc9251d11ac] # to [f96ab9a2476a98c91700778177d34d5050446548] # # patch "database.cc" # from [7b8fe9e102befb5254ab47915f4201e0c61b13c5] # to [a7ff056ae254016ef317eb08b489f1252b169c25] # # patch "database.hh" # from [e6cdf111a79b28e265dd1378ec5a215c6ce05039] # to [3ec4411410d8cf61559ccf763e68a3d59390a96a] # ============================================================ --- README.encapsulation 1fdd5795011a09dd0b09a49df82f57a4f4a786f4 +++ README.encapsulation 6abfc727291faeeba7b5a9765fc0d532c1b2ee45 @@ -27,9 +27,6 @@ database.cc: hook_get_author() hook_accept_testresult_change() - __app->get_project() - get_project() - __app->opts must_drop_attr() get_opt_author() ============================================================ --- cert.cc aa9c547033ac63c45efd6e82a72643fe90398dc3 +++ cert.cc b0908ee81de56cff78f0854d43c65637a8b74b7e @@ -481,7 +481,7 @@ guess_branch(revision_id const & ident, // Does not modify branch state in APP. void guess_branch(revision_id const & ident, database & db, - branch_name & branchname) + project_t & project, branch_name & branchname) { if (db.has_opt_branch() && !db.get_opt_branchname()().empty()) branchname = db.get_opt_branchname(); @@ -492,7 +492,7 @@ guess_branch(revision_id const & ident, "please provide a branch name")); set branches; - db.get_project().get_revision_branches(ident, branches); + project.get_revision_branches(ident, branches); N(branches.size() != 0, F("no branch certs found for revision %s, " @@ -510,10 +510,10 @@ void // As above, but set the branch name in the app state. void -guess_branch(revision_id const & ident, database & db) +guess_branch(revision_id const & ident, database & db, project_t & project) { branch_name branchname; - guess_branch(ident, db, branchname); + guess_branch(ident, db, project, branchname); db.set_opt_branchname(branchname); } ============================================================ --- cert.hh 587d7fa395ee45b3731447ab9eeb1721a2278cce +++ cert.hh 2700aa9422c6d9783cb252df855a39cb39bba03a @@ -25,6 +25,7 @@ class database; class key_store; class database; +class project_t; struct cert { @@ -107,9 +108,10 @@ void get_user_key(rsa_keypair_id & key, database & db); void -guess_branch(revision_id const & id, database & db, branch_name & branchname); +guess_branch(revision_id const & id, database & db, project_t & project, + branch_name & branchname); void -guess_branch(revision_id const & id, database & db); +guess_branch(revision_id const & id, database & db, project_t & project); #define date_cert_name cert_name("date") #define author_cert_name cert_name("author") ============================================================ --- cmd.hh 13b36cff4d760ca85548124e0ff51aaddd2d2c7e +++ cmd.hh 12b3632e47447c7749697a8bbb36a7d0b08af268 @@ -19,6 +19,7 @@ class database; class app_state; class database; +class project_t; struct workspace; namespace commands @@ -154,11 +155,11 @@ std::string } std::string -describe_revision(database & db, +describe_revision(database & db, project_t & project, revision_id const & id); void -complete(database & db, +complete(database & db, project_t & project, std::string const & str, revision_id & completion, bool must_exist=true); @@ -170,7 +171,7 @@ void bool must_exist=true); void -notify_if_multiple_heads(database & db); +notify_if_multiple_heads(project_t & project, branch_name const & branchname); void process_commit_message_args(bool & given, ============================================================ --- cmd_db.cc eee478f3a505c9630983790d6b720bf9f1bd6a94 +++ cmd_db.cc 00600193ed44613bcc5a0b56ecfbea64499f80cf @@ -121,7 +121,7 @@ CMD(db_kill_rev_locally, "kill_rev_local revision_id revid; - complete(app.db, idx(args, 0)(), revid); + complete(app.db, app.get_project(), idx(args, 0)(), revid); N(app.db.revision_exists(revid), F("no such revision '%s'") % revid); @@ -333,7 +333,7 @@ CMD(complete, "complete", "", CMD_REF(in i != completions.end(); ++i) { if (!verbose) cout << i->inner()() << '\n'; - else cout << describe_revision(app.db, *i) << '\n'; + else cout << describe_revision(app.db, app.get_project(), *i) << '\n'; } } else if (idx(args, 0)() == "file") ============================================================ --- cmd_diff_log.cc 6212181d5e3d7b90182b1253cf5a7006d8256af2 +++ cmd_diff_log.cc eae3ce2b4f7e22b659b211efb893aec61d0b2647 @@ -396,7 +396,8 @@ prepare_diff(cset & included, roster_t old_roster, restricted_roster, new_roster; revision_id r_old_id; - complete(app.db, idx(app.opts.revision_selectors, 0)(), r_old_id); + complete(app.db, app.get_project(), + idx(app.opts.revision_selectors, 0)(), r_old_id); N(app.db.revision_exists(r_old_id), F("no such revision '%s'") % r_old_id); @@ -424,8 +425,10 @@ prepare_diff(cset & included, roster_t old_roster, restricted_roster, new_roster; revision_id r_old_id, r_new_id; - complete(app.db, idx(app.opts.revision_selectors, 0)(), r_old_id); - complete(app.db, idx(app.opts.revision_selectors, 1)(), r_new_id); + complete(app.db, app.get_project(), + idx(app.opts.revision_selectors, 0)(), r_old_id); + complete(app.db, app.get_project(), + idx(app.opts.revision_selectors, 1)(), r_new_id); N(app.db.revision_exists(r_old_id), F("no such revision '%s'") % r_old_id); ============================================================ --- cmd_files.cc 54fe77df26911485cf7af092e61cb565a6ade369 +++ cmd_files.cc d598d5629971c8bb3d857f38de94320dec8c2ac7 @@ -168,7 +168,8 @@ CMD(annotate, "annotate", "", CMD_REF(in } else { - complete(app.db, idx(app.opts.revision_selectors, 0)(), rid); + complete(app.db, app.get_project(), + idx(app.opts.revision_selectors, 0)(), rid); N(!null_id(rid), F("no revision for file '%s' in database") % file); N(app.db.revision_exists(rid), @@ -247,21 +248,21 @@ static void } static void -dump_file(std::ostream & output, app_state & app, file_id & ident) +dump_file(std::ostream & output, database & db, file_id & ident) { - N(app.db.file_version_exists(ident), + N(db.file_version_exists(ident), F("no file version %s found in database") % ident); file_data dat; L(FL("dumping file %s") % ident); - app.db.get_file_version(ident, dat); + db.get_file_version(ident, dat); output.write(dat.inner()().data(), dat.inner()().size()); } static void -dump_file(std::ostream & output, app_state & app, revision_id rid, utf8 filename) +dump_file(std::ostream & output, database & db, revision_id rid, utf8 filename) { - N(app.db.revision_exists(rid), + N(db.revision_exists(rid), F("no such revision '%s'") % rid); // Paths are interpreted as standard external ones when we're in a @@ -270,7 +271,7 @@ dump_file(std::ostream & output, app_sta roster_t roster; marking_map marks; - app.db.get_roster(rid, roster, marks); + db.get_roster(rid, roster, marks); N(roster.has_node(fp), F("no file '%s' found in revision '%s'") % fp % rid); @@ -279,7 +280,7 @@ dump_file(std::ostream & output, app_sta F("no file '%s' found in revision '%s'") % fp % rid); file_t file_node = downcast_to_file_t(node); - dump_file(output, app, file_node->content); + dump_file(output, db, file_node->content); } CMD(cat, "cat", "", CMD_REF(informative), @@ -304,9 +305,10 @@ CMD(cat, "cat", "", CMD_REF(informative) rid = parent_id(parents.begin()); } else - complete(app.db, idx(app.opts.revision_selectors, 0)(), rid); + complete(app.db, app.get_project(), + idx(app.opts.revision_selectors, 0)(), rid); - dump_file(cout, app, rid, idx(args, 0)); + dump_file(cout, app.db, rid, idx(args, 0)); } // Name: get_file @@ -327,13 +329,11 @@ CMD_AUTOMATE(get_file, N_("FILEID"), N(args.size() == 1, F("wrong argument count")); - // FIXME: dump_file should not take app arg - file_id ident(idx(args, 0)()); - dump_file(output, app, ident); + dump_file(output, app.db, ident); } -// Name: get_fileof +// Name: get_file_of // Arguments: // 1: a filename // @@ -355,6 +355,8 @@ CMD_AUTOMATE(get_file_of, N_("FILENAME") N(args.size() == 1, F("wrong argument count")); + CMD_REQUIRES_DATABASE(app); + revision_id rid; if (app.opts.revision_selectors.size() == 0) { @@ -367,15 +369,11 @@ CMD_AUTOMATE(get_file_of, N_("FILENAME") rid = parent_id(parents.begin()); } else - { - CMD_REQUIRES_DATABASE(app); + complete(db, app.get_project(), + idx(app.opts.revision_selectors, 0)(), rid); - // FIXME: what about app.opts.revision_selectors? - complete(db, idx(app.opts.revision_selectors, 0)(), rid); - } - // FIXME: again, dump_file should not take app arg - dump_file(output, app, rid, idx(args, 0)); + dump_file(output, db, rid, idx(args, 0)); } // Local Variables: ============================================================ --- cmd_key_cert.cc 76dd54eb9659b916c562a30fbe6384c1ae2e2edc +++ cmd_key_cert.cc 346ceb2fb46108e32db112dc6310ad812aa9a7d4 @@ -193,7 +193,7 @@ CMD(cert, "cert", "", CMD_REF(key_and_ce transaction_guard guard(app.db); revision_id rid; - complete(app.db, idx(args, 0)(), rid); + complete(app.db, app.get_project(), idx(args, 0)(), rid); cert_name cname; internalize_cert_name(idx(args, 1), cname); @@ -225,7 +225,7 @@ CMD(trusted, "trusted", "", CMD_REF(key_ throw usage(execid); revision_id rid; - complete(app.db, idx(args, 0)(), rid, false); + complete(app.db, app.get_project(), idx(args, 0)(), rid, false); hexenc ident(rid.inner()); cert_name cname; @@ -272,7 +272,7 @@ CMD(tag, "tag", "", CMD_REF(review), N_( throw usage(execid); revision_id r; - complete(app.db, idx(args, 0)(), r); + complete(app.db, app.get_project(), idx(args, 0)(), r); cert_revision_tag(r, idx(args, 1)(), app.db); } @@ -287,7 +287,7 @@ CMD(testresult, "testresult", "", CMD_RE throw usage(execid); revision_id r; - complete(app.db, idx(args, 0)(), r); + complete(app.db, app.get_project(), idx(args, 0)(), r); cert_revision_testresult(r, idx(args, 1)(), app.db); } @@ -301,8 +301,8 @@ CMD(approve, "approve", "", CMD_REF(revi throw usage(execid); revision_id r; - complete(app.db, idx(args, 0)(), r); - guess_branch(r, app.db); + complete(app.db, app.get_project(), idx(args, 0)(), r); + guess_branch(r, app.db, app.get_project()); N(app.opts.branchname() != "", F("need --branch argument for approval")); app.get_project().put_revision_in_branch(r, app.opts.branchname); } @@ -316,8 +316,8 @@ CMD(suspend, "suspend", "", CMD_REF(revi throw usage(execid); revision_id r; - complete(app.db, idx(args, 0)(), r); - guess_branch(r, app.db); + complete(app.db, app.get_project(), idx(args, 0)(), r); + guess_branch(r, app.db, app.get_project()); N(app.opts.branchname() != "", F("need --branch argument to suspend")); app.get_project().suspend_revision_in_branch(r, app.opts.branchname); } @@ -345,7 +345,7 @@ CMD(comment, "comment", "", CMD_REF(revi F("empty comment")); revision_id r; - complete(app.db, idx(args, 0)(), r); + complete(app.db, app.get_project(), idx(args, 0)(), r); cert_revision_comment(r, comment, app.db); } ============================================================ --- cmd_list.cc 99af2b16b3355b6eb57a02299d31cc88285265a8 +++ cmd_list.cc 16049fb28f5a21a8d1e15afbabbd11d7d5874a30 @@ -62,7 +62,7 @@ CMD(certs, "certs", "", CMD_REF(list), " transaction_guard guard(app.db, false); revision_id ident; - complete(app.db, idx(args, 0)(), ident); + complete(app.db, app.get_project(), idx(args, 0)(), ident); vector< revision > ts; // FIXME_PROJECTS: after projects are implemented, // use the app.db version instead if no project is specified. ============================================================ --- cmd_merging.cc 60d92e3c90b4ca18c0460603fbef81fcc088a02a +++ cmd_merging.cc 0fa3eb83d02680c4be7da772663b8c7b8ecfb481 @@ -181,7 +181,8 @@ CMD(update, "update", "", CMD_REF(worksp P(F("multiple update candidates:")); for (set::const_iterator i = candidates.begin(); i != candidates.end(); ++i) - P(i18n_format(" %s") % describe_revision(app.db, *i)); + P(i18n_format(" %s") + % describe_revision(app.db, app.get_project(), *i)); P(F("choose one with '%s update -r'") % ui.prog_name); E(false, F("multiple update candidates remain after selection")); } @@ -189,7 +190,8 @@ CMD(update, "update", "", CMD_REF(worksp } else { - complete(app.db, app.opts.revision_selectors[0](), chosen_rid); + complete(app.db, app.get_project(), + app.opts.revision_selectors[0](), chosen_rid); N(app.db.revision_exists(chosen_rid), F("no such revision '%s'") % chosen_rid); } @@ -198,7 +200,7 @@ CMD(update, "update", "", CMD_REF(worksp // do this notification before checking to see if we can bail out early, // 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(app.db); + notify_if_multiple_heads(app.get_project(), app.opts.branchname); if (old_rid == chosen_rid) { @@ -693,7 +695,7 @@ CMD(merge_into_workspace, "merge_into_wo calculate_ident(working_rev, working_rid); } - complete(app.db, idx(args, 0)(), right_id); + complete(app.db, app.get_project(), idx(args, 0)(), right_id); app.db.get_roster(right_id, right); N(!(left_id == right_id), F("workspace is already at revision %s") % left_id); @@ -765,8 +767,8 @@ CMD(explicit_merge, "explicit_merge", "" if (args.size() != 3) throw usage(execid); - complete(app.db, idx(args, 0)(), left); - complete(app.db, idx(args, 1)(), right); + complete(app.db, app.get_project(), idx(args, 0)(), left); + complete(app.db, app.get_project(), idx(args, 1)(), right); branch = branch_name(idx(args, 2)()); N(!(left == right), @@ -788,8 +790,8 @@ CMD(show_conflicts, "show_conflicts", "" if (args.size() != 2) throw usage(execid); revision_id l_id, r_id; - complete(app.db, idx(args,0)(), l_id); - complete(app.db, idx(args,1)(), r_id); + complete(app.db, app.get_project(), idx(args,0)(), l_id); + complete(app.db, app.get_project(), idx(args,1)(), r_id); N(!is_ancestor(l_id, r_id, app.db), F("%s is an ancestor of %s; no merge is needed.") % l_id % r_id); N(!is_ancestor(r_id, l_id, app.db), @@ -855,7 +857,8 @@ CMD(pluck, "pluck", "", CMD_REF(workspac if (app.opts.revision_selectors.size() == 1) { - complete(app.db, idx(app.opts.revision_selectors, 0)(), to_rid); + complete(app.db, app.get_project(), + idx(app.opts.revision_selectors, 0)(), to_rid); N(app.db.revision_exists(to_rid), F("no such revision '%s'") % to_rid); std::set parents; @@ -870,10 +873,12 @@ CMD(pluck, "pluck", "", CMD_REF(workspac } else if (app.opts.revision_selectors.size() == 2) { - complete(app.db, idx(app.opts.revision_selectors, 0)(), from_rid); + complete(app.db, app.get_project(), + idx(app.opts.revision_selectors, 0)(), from_rid); N(app.db.revision_exists(from_rid), F("no such revision '%s'") % from_rid); - complete(app.db, idx(app.opts.revision_selectors, 1)(), to_rid); + complete(app.db, app.get_project(), + idx(app.opts.revision_selectors, 1)(), to_rid); N(app.db.revision_exists(to_rid), F("no such revision '%s'") % to_rid); } @@ -1049,7 +1054,7 @@ CMD(heads, "heads", "", CMD_REF(tree), " for (set::const_iterator i = heads.begin(); i != heads.end(); ++i) - cout << describe_revision(app.db, *i) << '\n'; + cout << describe_revision(app.db, app.get_project(), *i) << '\n'; } CMD(get_roster, "get_roster", "", CMD_REF(debug), N_("[REVID]"), @@ -1110,7 +1115,7 @@ CMD(get_roster, "get_roster", "", CMD_RE else if (args.size() == 1) { revision_id rid; - complete(app.db, idx(args, 0)(), rid); + complete(app.db, app.get_project(), idx(args, 0)(), rid); I(!null_id(rid)); app.db.get_roster(rid, roster, mm); } ============================================================ --- cmd_netsync.cc 070e7f74fe5b02d74df01d0d9a4979dcb1282be7 +++ cmd_netsync.cc 17573664fcdf96f623a7990da0de0e9cdbfaed43 @@ -349,7 +349,8 @@ CMD(clone, "clone", "", CMD_REF(network) { P(F("branch %s has multiple heads:") % app.opts.branchname); for (set::const_iterator i = heads.begin(); i != heads.end(); ++i) - P(i18n_format(" %s") % describe_revision(app.db, *i)); + P(i18n_format(" %s") + % describe_revision(app.db, app.get_project(), *i)); P(F("choose one with '%s checkout -r'") % ui.prog_name); E(false, F("branch %s has multiple heads") % app.opts.branchname); } @@ -358,11 +359,12 @@ CMD(clone, "clone", "", CMD_REF(network) else if (app.opts.revision_selectors.size() == 1) { // use specified revision - complete(app.db, idx(app.opts.revision_selectors, 0)(), ident); + complete(app.db, app.get_project(), + idx(app.opts.revision_selectors, 0)(), ident); N(app.db.revision_exists(ident), F("no such revision '%s'") % ident); - guess_branch(ident, app.db); + guess_branch(ident, app.db, app.get_project()); I(!app.opts.branchname().empty()); ============================================================ --- cmd_ws_commit.cc 2211926e7f74fc2957d46014cf7020e681c09a6f +++ cmd_ws_commit.cc 65bb925c7d7345dc7f7769f67a0f2f01b3b2bca8 @@ -296,13 +296,13 @@ CMD(disapprove, "disapprove", "", CMD_RE revision_id r; revision_t rev, rev_inverse; shared_ptr cs_inverse(new cset()); - complete(app.db, idx(args, 0)(), r); + complete(app.db, app.get_project(), idx(args, 0)(), r); app.db.get_revision(r, rev); N(rev.edges.size() == 1, F("revision %s has %d changesets, cannot invert") % r % rev.edges.size()); - guess_branch(r, app.db); + guess_branch(r, app.db, app.get_project()); N(app.opts.branchname() != "", F("need --branch argument for disapproval")); process_commit_message_args(log_message_given, log_message, app, @@ -551,7 +551,8 @@ CMD(checkout, "checkout", "co", CMD_REF( { P(F("branch %s has multiple heads:") % app.opts.branchname); for (set::const_iterator i = heads.begin(); i != heads.end(); ++i) - P(i18n_format(" %s") % describe_revision(app.db, *i)); + P(i18n_format(" %s") + % describe_revision(app.db, app.get_project(), *i)); P(F("choose one with '%s checkout -r'") % ui.prog_name); E(false, F("branch %s has multiple heads") % app.opts.branchname); } @@ -560,11 +561,12 @@ CMD(checkout, "checkout", "co", CMD_REF( else if (app.opts.revision_selectors.size() == 1) { // use specified revision - complete(app.db, idx(app.opts.revision_selectors, 0)(), revid); + complete(app.db, app.get_project(), + idx(app.opts.revision_selectors, 0)(), revid); N(app.db.revision_exists(revid), F("no such revision '%s'") % revid); - guess_branch(revid, app.db); + guess_branch(revid, app.db, app.get_project()); I(!app.opts.branchname().empty()); @@ -1039,7 +1041,8 @@ CMD(commit, "commit", "ci", CMD_REF(work i++) { // this will prefer --branch if it was set - guess_branch(edge_old_revision(i), app.db, bn_candidate); + guess_branch(edge_old_revision(i), app.db, app.get_project(), + bn_candidate); N(branchname() == "" || branchname == bn_candidate, F("parent revisions of this commit are in different branches:\n" "'%s' and '%s'.\n" @@ -1278,11 +1281,12 @@ CMD_NO_WORKSPACE(import, "import", "", C if (app.opts.revision_selectors.size() == 1) { // use specified revision - complete(app.db, idx(app.opts.revision_selectors, 0)(), ident); + complete(app.db, app.get_project(), + idx(app.opts.revision_selectors, 0)(), ident); N(app.db.revision_exists(ident), F("no such revision '%s'") % ident); - guess_branch(ident, app.db); + guess_branch(ident, app.db, app.get_project()); I(!app.opts.branchname().empty()); @@ -1302,7 +1306,8 @@ CMD_NO_WORKSPACE(import, "import", "", C { P(F("branch %s has multiple heads:") % app.opts.branchname); for (set::const_iterator i = heads.begin(); i != heads.end(); ++i) - P(i18n_format(" %s") % describe_revision(app.db, *i)); + P(i18n_format(" %s") + % describe_revision(app.db, app.get_project(), *i)); P(F("choose one with '%s checkout -r'") % ui.prog_name); E(false, F("branch %s has multiple heads") % app.opts.branchname); } ============================================================ --- commands.cc b914eda21abeb6c043a8d05f10822fc9251d11ac +++ commands.cc f96ab9a2476a98c91700778177d34d5050446548 @@ -853,7 +853,7 @@ string } string -describe_revision(database & db, +describe_revision(database & db, project_t & project, revision_id const & id) { cert_name author_name(author_cert_name); @@ -865,7 +865,7 @@ describe_revision(database & db, // append authors and date of this revision vector< revision > tmp; - db.get_project().get_revision_certs_by_name(id, author_name, tmp); + project.get_revision_certs_by_name(id, author_name, tmp); for (vector< revision >::const_iterator i = tmp.begin(); i != tmp.end(); ++i) { @@ -874,7 +874,7 @@ describe_revision(database & db, description += " "; description += tv(); } - db.get_project().get_revision_certs_by_name(id, date_name, tmp); + project.get_revision_certs_by_name(id, date_name, tmp); for (vector< revision >::const_iterator i = tmp.begin(); i != tmp.end(); ++i) { @@ -933,7 +933,7 @@ void void -complete(database & db, +complete(database & db, project_t & project, string const & str, revision_id & completion, bool must_exist) @@ -947,7 +947,7 @@ complete(database & db, string err = (F("selection '%s' has multiple ambiguous expansions:") % str).str(); for (set::const_iterator i = completions.begin(); i != completions.end(); ++i) - err += ("\n" + describe_revision(db, *i)); + err += ("\n" + describe_revision(db, project, *i)); N(completions.size() == 1, i18n_format(err)); } @@ -955,17 +955,18 @@ void } void -notify_if_multiple_heads(database & db) +notify_if_multiple_heads(project_t & project, + branch_name const & branchname) { set heads; - db.get_project().get_branch_heads(db.get_opt_branchname(), heads); + project.get_branch_heads(branchname, heads); if (heads.size() > 1) { string prefixedline; prefix_lines_with(_("note: "), _("branch '%s' has multiple heads\n" "perhaps consider '%s merge'"), prefixedline); - P(i18n_format(prefixedline) % db.get_opt_branchname() % ui.prog_name); + P(i18n_format(prefixedline) % branchname % ui.prog_name); } } ============================================================ --- database.cc 7b8fe9e102befb5254ab47915f4201e0c61b13c5 +++ database.cc a7ff056ae254016ef317eb08b489f1252b169c25 @@ -3567,12 +3567,6 @@ database::get_key_store() return __app->keys; } -project_t & -database::get_project() -{ - return __app->get_project(); -} - bool database::must_drop_attr(string const & key) { ============================================================ --- database.hh e6cdf111a79b28e265dd1378ec5a215c6ce05039 +++ database.hh 3ec4411410d8cf61559ccf763e68a3d59390a96a @@ -623,7 +623,6 @@ public: void set_opt_branchname(branch_name const & branchname); key_store & get_key_store(); - project_t & get_project(); }; // not a member function, defined in database_check.cc