# # # patch "annotate.cc" # from [f8bdcdefe26fbc19374b57c0cc971908ae56f88a] # to [745a698f90c16ce73bf1fb718721ec74061ed5b4] # # patch "app_state.cc" # from [008934c37947ce841574efb158c152114310f4ea] # to [5e98b548e6d8148def8a8d374529b926131caa18] # # patch "app_state.hh" # from [05687e8b874e1fef4b1ae9a36f7f4951f33db5ca] # to [94ec00bb1b5576a83ae304e65abcb51dd9eb6b57] # # patch "automate.cc" # from [ebd25c3cd09ca4f3d6538de4dab1261d0aeb3486] # to [e039dbfb33e8212ec952abe292837f32128f63ba] # # patch "cert.cc" # from [de57eef79d80980042168a581f6e85cbb9e3f147] # to [ebca1d1dccde5eb33addd2f0af1d5cdb38e079d7] # # patch "cmd_diff_log.cc" # from [5a1f811289a1b1fc760623959877055bdc0c9e64] # to [40e1f83995dd5043a41fa7eed2669b2ff89c0af8] # # patch "cmd_key_cert.cc" # from [3241526b563ed572a5abcd9a3304ae8f37ec33b0] # to [4e2e4cbbf0f59dd5570060878e960ba07c60c966] # # patch "cmd_list.cc" # from [80fe7cdf7a2816f956bc54e7b7cba6f023db1d84] # to [4cde746983b3d3ddc7845478ff65a4e61cf071a5] # # patch "cmd_merging.cc" # from [112d08ea9d7d3e72e37be28a29f6382e9b7614d4] # to [6e01b15be1c4eb05ccbfbac27911a204c385fee2] # # patch "cmd_ws_commit.cc" # from [c6fe07700cef1c3e60c176f504fad622958eceba] # to [48b9204dbc184bdabb06be95c50fec90a406c737] # # patch "commands.cc" # from [b511e36ce10116f262399abda75d41f2677dd26a] # to [0790260cd921d2cbaf2f863d78be5101e292a9bf] # # patch "database.cc" # from [f93a884890ae1d7eb7ee537ab815e556a1887e68] # to [e2d0e6787ec707a150d3befb45e4811b80f40493] # # patch "enumerator.cc" # from [4d3be4e2bab1e951b2576b3a8111981800e6533e] # to [876a65fddaf09ddc8ca926ad20d6c47c4898f205] # # patch "netsync.cc" # from [cec5aa9f9388baab0617a4497744ba9a8679039e] # to [83d9a60c55b895f2a6d75103bc82ddad930867a1] # # patch "rcs_import.cc" # from [ec31df86841d31110bb1ac9e55face801ad7446f] # to [7cd5a5487b252ade9f829d7770445eacad0cbee3] # # patch "update.cc" # from [75170a43066b7b681a8f134b0da79805d67d7c2c] # to [b0b042f58ab26cc380a3cc5c7669e928cd0e61f1] # ============================================================ --- annotate.cc f8bdcdefe26fbc19374b57c0cc971908ae56f88a +++ annotate.cc 745a698f90c16ce73bf1fb718721ec74061ed5b4 @@ -377,7 +377,7 @@ annotate_context::build_revisions_to_ann i != seen.end(); i++) { vector< revision > certs; - app.project.get_revision_certs(*i, certs); + app.get_project().get_revision_certs(*i, certs); erase_bogus_certs(certs, app); string author(cert_string_value(certs, author_cert_name, ============================================================ --- app_state.cc 008934c37947ce841574efb158c152114310f4ea +++ app_state.cc 5e98b548e6d8148def8a8d374529b926131caa18 @@ -194,6 +194,12 @@ app_state::make_branch_sticky() } } +project_t & +app_state::get_project() +{ + return project; +} + void app_state::set_root(system_path const & path) { ============================================================ --- app_state.hh 05687e8b874e1fef4b1ae9a36f7f4951f33db5ca +++ app_state.hh 94ec00bb1b5576a83ae304e65abcb51dd9eb6b57 @@ -81,8 +81,11 @@ public: void make_branch_sticky(); - +private: project_t project; +public: + //project_t & get_project(string const & name); + project_t & get_project(); // get_project(opts.project) or I() void set_database(system_path const & filename); void set_key_dir(system_path const & filename); ============================================================ --- automate.cc ebd25c3cd09ca4f3d6538de4dab1261d0aeb3486 +++ automate.cc e039dbfb33e8212ec952abe292837f32128f63ba @@ -71,7 +71,7 @@ AUTOMATE(heads, N_("[BRANCH]"), options: app.opts.branch_name = idx(args, 0); } set heads; - app.project.get_branch_heads(app.opts.branch_name(), heads); + app.get_project().get_branch_heads(app.opts.branch_name(), heads); for (set::const_iterator i = heads.begin(); i != heads.end(); ++i) output << (*i).inner()() << "\n"; } @@ -1111,7 +1111,7 @@ AUTOMATE(packets_for_certs, N_("REVID"), N(app.db.revision_exists(r_id), F("no such revision '%s'") % r_id); - app.project.get_revision_certs(r_id, certs); + app.get_project().get_revision_certs(r_id, certs); for (size_t i = 0; i < certs.size(); ++i) pw.consume_revision_cert(idx(certs,i)); } @@ -1257,7 +1257,7 @@ AUTOMATE(branches, "", options::opts::no set names; - app.project.get_branch_list(names); + app.get_project().get_branch_list(names); for (set::const_iterator i = names.begin(); i != names.end(); ++i) @@ -1319,13 +1319,13 @@ AUTOMATE(tags, N_("[BRANCH_PATTERN]"), o prt.print_stanza(stz); set tags; - app.project.get_tags(tags); + app.get_project().get_tags(tags); for (set::const_iterator tag = tags.begin(); tag != tags.end(); ++tag) { set branches; - app.project.get_revision_branches(tag->ident, branches); + app.get_project().get_revision_branches(tag->ident, branches); bool show(!filtering); vector branch_names; ============================================================ --- cert.cc de57eef79d80980042168a581f6e85cbb9e3f147 +++ cert.cc ebca1d1dccde5eb33addd2f0af1d5cdb38e079d7 @@ -485,7 +485,7 @@ guess_branch(revision_id const & ident, "please provide a branch name")); set branches; - app.project.get_revision_branches(ident, branches); + app.get_project().get_revision_branches(ident, branches); N(branches.size() != 0, F("no branch certs found for revision %s, " ============================================================ --- cmd_diff_log.cc 5a1f811289a1b1fc760623959877055bdc0c9e64 +++ cmd_diff_log.cc 40e1f83995dd5043a41fa7eed2669b2ff89c0af8 @@ -541,7 +541,7 @@ log_certs(app_state & app, revision_id i if (multiline) newline = true; - app.project.get_revision_certs_by_name(id, name, certs); + app.get_project().get_revision_certs_by_name(id, name, certs); for (vector< revision >::const_iterator i = certs.begin(); i != certs.end(); ++i) { ============================================================ --- cmd_key_cert.cc 3241526b563ed572a5abcd9a3304ae8f37ec33b0 +++ cmd_key_cert.cc 4e2e4cbbf0f59dd5570060878e960ba07c60c966 @@ -136,7 +136,7 @@ CMD(cert, N_("key and cert"), N_("REVISI val = cert_value(get_stdin()); packet_db_writer dbw(app); - app.project.put_cert(ident, name, val, dbw); + app.get_project().put_cert(ident, name, val, dbw); guard.commit(); } ============================================================ --- cmd_list.cc 80fe7cdf7a2816f956bc54e7b7cba6f023db1d84 +++ cmd_list.cc 4cde746983b3d3ddc7845478ff65a4e61cf071a5 @@ -53,7 +53,7 @@ ls_certs(string const & name, app_state vector< revision > ts; // FIXME_PROJECTS: after projects are implemented, // use the app.db version instead if no project is specified. - app.project.get_revision_certs(ident, ts); + app.get_project().get_revision_certs(ident, ts); for (size_t i = 0; i < ts.size(); ++i) certs.push_back(idx(ts, i).inner()); @@ -244,7 +244,7 @@ ls_branches(string name, app_state & app combine_and_check_globish(app.opts.exclude_patterns, exc); globish_matcher match(inc, exc); set names; - app.project.get_branch_list(names); + app.get_project().get_branch_list(names); for (set::const_iterator i = names.begin(); i != names.end(); ++i) @@ -288,7 +288,7 @@ ls_tags(string name, app_state & app, ve ls_tags(string name, app_state & app, vector const & args) { set tags; - app.project.get_tags(tags); + app.get_project().get_tags(tags); for (set::const_iterator i = tags.begin(); i != tags.end(); ++i) { @@ -679,7 +679,7 @@ AUTOMATE(certs, N_("REV"), options::opts vector< revision > ts; // FIXME_PROJECTS: after projects are implemented, // use the app.db version instead if no project is specified. - app.project.get_revision_certs(rid, ts); + app.get_project().get_revision_certs(rid, ts); for (size_t i = 0; i < ts.size(); ++i) certs.push_back(idx(ts, i).inner()); ============================================================ --- cmd_merging.cc 112d08ea9d7d3e72e37be28a29f6382e9b7614d4 +++ cmd_merging.cc 6e01b15be1c4eb05ccbfbac27911a204c385fee2 @@ -150,7 +150,7 @@ CMD(update, N_("workspace"), "", { // figure out which branches the target is in set< utf8 > branches; - app.project.get_revision_branches(chosen_rid, branches); + app.get_project().get_revision_branches(chosen_rid, branches); if (branches.find(app.opts.branch_name) != branches.end()) { @@ -296,7 +296,7 @@ merge_two(revision_id const & left, revi interactive_merge_and_store(left, right, merged, app); packet_db_writer dbw(app); - app.project.put_standard_certs_from_options(merged, + app.get_project().put_standard_certs_from_options(merged, branch, log.str(), dbw); @@ -322,7 +322,7 @@ CMD(merge, N_("tree"), "", N_("merge unm F("please specify a branch, with --branch=BRANCH")); set heads; - app.project.get_branch_heads(app.opts.branch_name(), heads); + app.get_project().get_branch_heads(app.opts.branch_name(), heads); N(heads.size() != 0, F("branch '%s' is empty") % app.opts.branch_name); if (heads.size() == 1) @@ -390,7 +390,7 @@ CMD(merge, N_("tree"), "", N_("merge unm ancestors.clear(); heads_for_ancestor.clear(); - app.project.get_branch_heads(app.opts.branch_name(), heads); + app.get_project().get_branch_heads(app.opts.branch_name(), heads); pass++; } @@ -455,8 +455,8 @@ CMD(merge_into_dir, N_("tree"), N_("SOUR if (args.size() != 3) throw usage(name); - app.project.get_branch_heads(idx(args, 0)(), src_heads); - app.project.get_branch_heads(idx(args, 1)(), dst_heads); + app.get_project().get_branch_heads(idx(args, 0)(), src_heads); + app.get_project().get_branch_heads(idx(args, 1)(), dst_heads); N(src_heads.size() != 0, F("branch '%s' is empty") % idx(args, 0)()); N(src_heads.size() == 1, F("branch '%s' is not merged") % idx(args, 0)()); @@ -484,7 +484,7 @@ CMD(merge_into_dir, N_("tree"), N_("SOUR % (*src_i) % idx(args, 1)()); transaction_guard guard(app.db); packet_db_writer dbw(app); - app.project.put_revision_in_branch(*src_i, idx(args, 1), dbw); + app.get_project().put_revision_in_branch(*src_i, idx(args, 1), dbw); guard.commit(); } else @@ -567,7 +567,7 @@ CMD(merge_into_dir, N_("tree"), N_("SOUR % idx(args, 1) % (*dst_i)).str(); packet_db_writer dbw(app); - app.project.put_standard_certs_from_options(merged, + app.get_project().put_standard_certs_from_options(merged, idx(args, 1), log_message(), dbw); @@ -820,7 +820,7 @@ CMD(heads, N_("tree"), "", N_("show unme N(app.opts.branch_name() != "", F("please specify a branch, with --branch=BRANCH")); - app.project.get_branch_heads(app.opts.branch_name(), heads); + app.get_project().get_branch_heads(app.opts.branch_name(), heads); if (heads.size() == 0) P(F("branch '%s' is empty") % app.opts.branch_name); ============================================================ --- cmd_ws_commit.cc c6fe07700cef1c3e60c176f504fad622958eceba +++ cmd_ws_commit.cc 48b9204dbc184bdabb06be95c50fec90a406c737 @@ -247,7 +247,7 @@ CMD(disapprove, N_("review"), N_("REVISI calculate_ident(rdat, inv_id); dbw.consume_revision_data(inv_id, rdat); - app.project.put_standard_certs_from_options(inv_id, + app.get_project().put_standard_certs_from_options(inv_id, branchname(), log_message(), dbw); @@ -496,7 +496,7 @@ CMD(checkout, N_("tree"), N_("[DIRECTORY F("use --revision or --branch to specify what to checkout")); set heads; - app.project.get_branch_heads(app.opts.branch_name, heads); + app.get_project().get_branch_heads(app.opts.branch_name, heads); N(heads.size() > 0, F("branch '%s' is empty") % app.opts.branch_name); if (heads.size() > 1) @@ -521,7 +521,7 @@ CMD(checkout, N_("tree"), N_("[DIRECTORY I(!app.opts.branch_name().empty()); - N(app.project.revision_is_in_branch(ident, app.opts.branch_name), + N(app.get_project().revision_is_in_branch(ident, app.opts.branch_name), F("revision %s is not a member of branch %s") % ident % app.opts.branch_name); } @@ -742,7 +742,7 @@ CMD(commit, N_("workspace"), N_("[PATH]. I(restricted_rev.edges.size() == 1); set heads; - app.project.get_branch_heads(app.opts.branch_name, heads); + app.get_project().get_branch_heads(app.opts.branch_name, heads); unsigned int old_head_size = heads.size(); if (app.opts.branch_name() != "") @@ -889,7 +889,7 @@ CMD(commit, N_("workspace"), N_("[PATH]. write_revision(restricted_rev, rdat); dbw.consume_revision_data(restricted_rev_id, rdat); - app.project.put_standard_certs_from_options(restricted_rev_id, + app.get_project().put_standard_certs_from_options(restricted_rev_id, branchname(), log_message(), dbw); @@ -907,7 +907,7 @@ CMD(commit, N_("workspace"), N_("[PATH]. app.work.blank_user_log(); - app.project.get_branch_heads(app.opts.branch_name, heads); + app.get_project().get_branch_heads(app.opts.branch_name, heads); if (heads.size() > old_head_size && old_head_size > 0) { P(F("note: this revision creates divergence\n" "note: you may (or may not) wish to run '%s merge'") @@ -925,7 +925,7 @@ CMD(commit, N_("workspace"), N_("[PATH]. // later. map certs; vector< revision > ctmp; - app.project.get_revision_certs(restricted_rev_id, ctmp); + app.get_project().get_revision_certs(restricted_rev_id, ctmp); for (vector< revision >::const_iterator i = ctmp.begin(); i != ctmp.end(); ++i) { @@ -991,7 +991,7 @@ CMD_NO_WORKSPACE(import, N_("tree"), N_( I(!app.opts.branch_name().empty()); - N(app.project.revision_is_in_branch(ident, app.opts.branch_name), + N(app.get_project().revision_is_in_branch(ident, app.opts.branch_name), F("revision %s is not a member of branch %s") % ident % app.opts.branch_name); } @@ -1002,7 +1002,7 @@ CMD_NO_WORKSPACE(import, N_("tree"), N_( F("use --revision or --branch to specify what to checkout")); set heads; - app.project.get_branch_heads(app.opts.branch_name, heads); + app.get_project().get_branch_heads(app.opts.branch_name, heads); if (heads.size() > 1) { P(F("branch %s has multiple heads:") % app.opts.branch_name); ============================================================ --- commands.cc b511e36ce10116f262399abda75d41f2677dd26a +++ commands.cc 0790260cd921d2cbaf2f863d78be5101e292a9bf @@ -368,7 +368,7 @@ describe_revision(app_state & app, // append authors and date of this revision vector< revision > tmp; - app.project.get_revision_certs_by_name(id, author_name, tmp); + app.get_project().get_revision_certs_by_name(id, author_name, tmp); for (vector< revision >::const_iterator i = tmp.begin(); i != tmp.end(); ++i) { @@ -377,7 +377,7 @@ describe_revision(app_state & app, description += " "; description += tv(); } - app.project.get_revision_certs_by_name(id, date_name, tmp); + app.get_project().get_revision_certs_by_name(id, date_name, tmp); for (vector< revision >::const_iterator i = tmp.begin(); i != tmp.end(); ++i) { @@ -460,7 +460,7 @@ notify_if_multiple_heads(app_state & app notify_if_multiple_heads(app_state & app) { set heads; - app.project.get_branch_heads(app.opts.branch_name, heads); + app.get_project().get_branch_heads(app.opts.branch_name, heads); if (heads.size() > 1) { string prefixedline; prefix_lines_with(_("note: "), ============================================================ --- database.cc f93a884890ae1d7eb7ee537ab815e556a1887e68 +++ database.cc e2d0e6787ec707a150d3befb45e4811b80f40493 @@ -2600,7 +2600,7 @@ void database::complete(selector_type ty } else { - __app->project.get_branch_list(i->second, branch_names); + __app->get_project().get_branch_list(i->second, branch_names); } // for each branch name, get the branch heads @@ -2609,7 +2609,7 @@ void database::complete(selector_type ty bn != branch_names.end(); bn++) { set branch_heads; - __app->project.get_branch_heads(*bn, branch_heads); + __app->get_project().get_branch_heads(*bn, branch_heads); heads.insert(branch_heads.begin(), branch_heads.end()); L(FL("after get_branch_heads for %s, heads has %d entries") % (*bn) % heads.size()); } ============================================================ --- enumerator.cc 4d3be4e2bab1e951b2576b3a8111981800e6533e +++ enumerator.cc 876a65fddaf09ddc8ca926ad20d6c47c4898f205 @@ -202,7 +202,7 @@ revision_enumerator::get_revision_certs( } if (!found_one) { - app.project.get_revision_cert_hashes(rid, hashes); + app.get_project().get_revision_cert_hashes(rid, hashes); } } ============================================================ --- netsync.cc cec5aa9f9388baab0617a4497744ba9a8679039e +++ netsync.cc 83d9a60c55b895f2a6d75103bc82ddad930867a1 @@ -1336,7 +1336,7 @@ session::process_hello_cmd(rsa_keypair_i // clients always include in the synchronization set, every branch that the // user requested set all_branches, ok_branches; - app.project.get_branch_list(all_branches); + app.get_project().get_branch_list(all_branches); for (set::const_iterator i = all_branches.begin(); i != all_branches.end(); i++) { @@ -1429,7 +1429,7 @@ session::process_anonymous_cmd(protocol_ } set all_branches, ok_branches; - app.project.get_branch_list(all_branches); + app.get_project().get_branch_list(all_branches); globish_matcher their_matcher(their_include_pattern, their_exclude_pattern); for (set::const_iterator i = all_branches.begin(); i != all_branches.end(); i++) @@ -1562,7 +1562,7 @@ session::process_auth_cmd(protocol_role } set all_branches, ok_branches; - app.project.get_branch_list(all_branches); + app.get_project().get_branch_list(all_branches); for (set::const_iterator i = all_branches.begin(); i != all_branches.end(); i++) { @@ -3068,7 +3068,7 @@ session::rebuild_merkle_trees(app_state // FIXME_PROJECTS: probably something like // app.get_project(i->project).get_branch_certs(i->branch) // or so. - app.project.get_branch_certs(*i, certs); + app.get_project().get_branch_certs(*i, certs); for (vector< revision >::const_iterator j = certs.begin(); j != certs.end(); j++) { ============================================================ --- rcs_import.cc ec31df86841d31110bb1ac9e55face801ad7446f +++ rcs_import.cc 7cd5a5487b252ade9f829d7770445eacad0cbee3 @@ -1275,7 +1275,7 @@ import_cvs_repo(system_path const & cvsr { string tag = cvs.tag_interner.lookup(i->first); ui.set_tick_trailer("marking tag " + tag); - app.project.put_tag(i->second.second, tag, dbw); + app.get_project().put_tag(i->second.second, tag, dbw); ++n_tags; } guard.commit(); @@ -1387,7 +1387,7 @@ cluster_consumer::store_auxiliary_certs( } } - app.project.put_standard_certs(p.rid, + app.get_project().put_standard_certs(p.rid, branchname, cvs.changelog_interner.lookup(p.changelog), time_from_time_t(p.time), ============================================================ --- update.cc 75170a43066b7b681a8f134b0da79805d67d7c2c +++ update.cc b0b042f58ab26cc380a3cc5c7669e928cd0e61f1 @@ -55,7 +55,7 @@ get_test_results_for_revision(revision_i app_state & app) { vector< revision > certs; - app.project.get_revision_certs_by_name(id, testresult_cert_name, certs); + app.get_project().get_revision_certs_by_name(id, testresult_cert_name, certs); for (vector< revision >::const_iterator i = certs.begin(); i != certs.end(); ++i) { @@ -83,7 +83,7 @@ acceptable_descendent(cert_value const & L(FL("Considering update target %s") % target); // step 1: check the branch - if (!app.project.revision_is_in_branch(target, branch())) + if (!app.get_project().revision_is_in_branch(target, branch())) { L(FL("%s not in branch %s") % target % branch); return false;