# # # patch "app_state.cc" # from [ab42ce782bb39f6f9895c8d652afe9740d335655] # to [2ef7b90bb25a19730416fd0dfcd4ea7f8f1d2022] # # patch "automate.cc" # from [1c29dbf96103bd040cda530c7bba9a2d3fb2fbfa] # to [6781382c3fe9d04a96073a4a1257b9dab120014d] # # patch "cmd_diff_log.cc" # from [3cbde32f82993189490ae13350e2f8fccaf1413d] # to [3f8ec203fb549c87a6b8f1890dade288958410e4] # # patch "cmd_files.cc" # from [4011824d9e255a6045bfcabe318bf5e1face7053] # to [dcd30f845947efba384c8a9f2f7da24a0c6c3a7b] # # patch "cmd_list.cc" # from [87adfa5ac893ed93b4244093eb1c66052afae20a] # to [14968f851ed523d7b1fea555479cb375500c5979] # # patch "cmd_merging.cc" # from [828529631c9bd6f1d24fafcae93ced4102dbb5c3] # to [22291270923c56d208f2c878eac5b7f04d4739db] # # patch "cmd_netsync.cc" # from [3480dd77ea18cca0fe7842b0d4807f7e7183a76f] # to [46165ee435b96b6b4ec44c1c9e376a2ca8c06478] # # patch "cmd_ws_commit.cc" # from [a58f8793fc0c9efff8699dd358922f6c7076f6d3] # to [ebec7449ba110d4c11c4442b655b549a8561e6d7] # # patch "work.cc" # from [923e55fbbdefb8123ad42a101809a017a6a86188] # to [87e512a4354848adfe6fcfba64a24ec1e9fdcff7] # # patch "work.hh" # from [8797491e6dd9884bbbb4a76dc00e87b5dfd9f7f9] # to [f7dac1c4950fd46cd98ca8a36e3da2eddf7ec04b] # ============================================================ --- app_state.cc ab42ce782bb39f6f9895c8d652afe9740d335655 +++ app_state.cc 2ef7b90bb25a19730416fd0dfcd4ea7f8f1d2022 @@ -36,7 +36,7 @@ app_state::app_state() app_state::app_state() : db(system_path()), - keys(this), work(db, lua), + keys(this), work(lua), // search_root(current_root_path()), // diff_format(unified_diff), branch_is_sticky(false), ============================================================ --- automate.cc 1c29dbf96103bd040cda530c7bba9a2d3fb2fbfa +++ automate.cc 6781382c3fe9d04a96073a4a1257b9dab120014d @@ -229,8 +229,8 @@ AUTOMATE(attributes, N_("FILE"), options temp_node_id_source nis; // get the base and the current roster of this workspace - app.work.get_current_roster_shape(current, nis); - app.work.get_parent_rosters(parents); + app.work.get_current_roster_shape(current, app.db, nis); + app.work.get_parent_rosters(parents, app.db); N(parents.size() == 1, F("this command can only be used in a single-parent workspace")); base = parent_roster(parents.begin()); @@ -724,7 +724,7 @@ AUTOMATE(inventory, "", options::opts::n cset cs; MM(cs); path_set unchanged, changed, missing, unknown, ignored; - app.work.get_current_roster_shape(curr, nis); + app.work.get_current_roster_shape(curr, app.db, nis); app.work.get_work_rev(rev); N(rev.edges.size() == 1, F("this command can only be used in a single-parent workspace")); @@ -756,7 +756,7 @@ AUTOMATE(inventory, "", options::opts::n roots.push_back(file_path()); app.work.classify_roster_paths(curr, unchanged, changed, missing); - app.work.find_unknown_and_ignored(mask, roots, unknown, ignored); + app.work.find_unknown_and_ignored(mask, roots, unknown, ignored, app.db); inventory_node_state(inventory, unchanged, inventory_item::UNCHANGED_NODE); @@ -926,8 +926,8 @@ AUTOMATE(get_revision, N_("[REVID]"), op revision_t rev; app.require_workspace(); - app.work.get_parent_rosters(old_rosters); - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_parent_rosters(old_rosters, app.db); + app.work.get_current_roster_shape(new_roster, app.db, nis); app.work.update_current_roster_from_filesystem(new_roster); make_revision(old_rosters, new_roster, rev); @@ -961,7 +961,7 @@ AUTOMATE(get_base_revision_id, "", optio app.require_workspace(); parent_map parents; - app.work.get_parent_rosters(parents); + app.work.get_parent_rosters(parents, app.db); N(parents.size() == 1, F("this command can only be used in a single-parent workspace")); @@ -991,10 +991,10 @@ AUTOMATE(get_current_revision_id, "", op temp_node_id_source nis; app.require_workspace(); - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_current_roster_shape(new_roster, app.db, nis); app.work.update_current_roster_from_filesystem(new_roster); - app.work.get_parent_rosters(parents); + app.work.get_parent_rosters(parents, app.db); make_revision(parents, new_roster, rev); calculate_ident(rev, new_revision_id); @@ -1057,7 +1057,7 @@ AUTOMATE(get_manifest_of, N_("[REVID]"), temp_node_id_source nis; app.require_workspace(); - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_current_roster_shape(new_roster, app.db, nis); app.work.update_current_roster_from_filesystem(new_roster); } else ============================================================ --- cmd_diff_log.cc 3cbde32f82993189490ae13350e2f8fccaf1413d +++ cmd_diff_log.cc 3f8ec203fb549c87a6b8f1890dade288958410e4 @@ -361,7 +361,7 @@ prepare_diff(cset & included, revision_id old_rid; parent_map parents; - app.work.get_parent_rosters(parents); + app.work.get_parent_rosters(parents, app.db); // With no arguments, which parent should we diff against? N(parents.size() == 1, @@ -370,7 +370,7 @@ prepare_diff(cset & included, old_rid = parent_id(parents.begin()); old_roster = parent_roster(parents.begin()); - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_current_roster_shape(new_roster, app.db, nis); node_restriction mask(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), @@ -395,7 +395,7 @@ prepare_diff(cset & included, F("no such revision '%s'") % r_old_id); app.db.get_roster(r_old_id, old_roster); - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_current_roster_shape(new_roster, app.db, nis); node_restriction mask(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), @@ -659,8 +659,8 @@ CMD(log, N_("informative"), N_("[FILE] . parent_map parents; temp_node_id_source nis; - app.work.get_parent_rosters(parents); - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_parent_rosters(parents, app.db); + app.work.get_current_roster_shape(new_roster, app.db, nis); mask = node_restriction(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), ============================================================ --- cmd_files.cc 4011824d9e255a6045bfcabe318bf5e1face7053 +++ cmd_files.cc dcd30f845947efba384c8a9f2f7da24a0c6c3a7b @@ -256,7 +256,7 @@ CMD(cat, N_("informative"), app.require_workspace(); parent_map parents; - app.work.get_parent_rosters(parents); + app.work.get_parent_rosters(parents, app.db); N(parents.size() == 1, F("this command can only be used in a single-parent workspace")); rid = parent_id(parents.begin()); @@ -311,7 +311,7 @@ AUTOMATE(get_file_of, N_("FILENAME"), op app.require_workspace(); parent_map parents; - app.work.get_parent_rosters(parents); + app.work.get_parent_rosters(parents, app.db); N(parents.size() == 1, F("this command can only be used in a single-parent workspace")); rid = parent_id(parents.begin()); ============================================================ --- cmd_list.cc 87adfa5ac893ed93b4244093eb1c66052afae20a +++ cmd_list.cc 14968f851ed523d7b1fea555479cb375500c5979 @@ -339,7 +339,7 @@ ls_known(app_state & app, vector c temp_node_id_source nis; app.require_workspace(); - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_current_roster_shape(new_roster, app.db, nis); node_restriction mask(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), @@ -387,7 +387,7 @@ ls_unknown_or_ignored(app_state & app, b if (roots.empty()) roots.push_back(file_path()); - app.work.find_unknown_and_ignored(mask, roots, unknown, ignored); + app.work.find_unknown_and_ignored(mask, roots, unknown, ignored, app.db); if (want_ignored) for (path_set::const_iterator i = ignored.begin(); @@ -404,7 +404,7 @@ ls_missing(app_state & app, vector { temp_node_id_source nis; roster_t current_roster_shape; - app.work.get_current_roster_shape(current_roster_shape, nis); + app.work.get_current_roster_shape(current_roster_shape, app.db, nis); node_restriction mask(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), app.opts.depth, @@ -430,10 +430,10 @@ ls_changed(app_state & app, vector app.require_workspace(); - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_current_roster_shape(new_roster, app.db, nis); app.work.update_current_roster_from_filesystem(new_roster); - app.work.get_parent_rosters(parents); + app.work.get_parent_rosters(parents, app.db); node_restriction mask(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), ============================================================ --- cmd_merging.cc 828529631c9bd6f1d24fafcae93ced4102dbb5c3 +++ cmd_merging.cc 22291270923c56d208f2c878eac5b7f04d4739db @@ -143,7 +143,7 @@ CMD(update, N_("workspace"), "", // Figure out where we are parent_map parents; - app.work.get_parent_rosters(parents); + app.work.get_parent_rosters(parents, app.db); N(parents.size() == 1, F("this command can only be used in a single-parent workspace")); @@ -232,7 +232,7 @@ CMD(update, N_("workspace"), "", = parent_cached_roster(parents.begin()).first; MM(*old_roster); roster_t working_roster; MM(working_roster); - app.work.get_current_roster_shape(working_roster, nis); + app.work.get_current_roster_shape(working_roster, app.db, nis); app.work.update_current_roster_from_filesystem(working_roster); // Get the CHOSEN roster @@ -259,7 +259,7 @@ CMD(update, N_("workspace"), "", // Now finally modify the workspace cset update; make_cset(working_roster, merged_roster, update); - app.work.perform_content_update(update, wca); + app.work.perform_content_update(update, wca, app.db); revision_t remaining; make_revision_for_workspace(chosen_rid, chosen_roster, @@ -267,8 +267,8 @@ CMD(update, N_("workspace"), "", // small race condition here... app.work.put_work_rev(remaining); - app.work.update_any_attrs(); - app.work.maybe_update_inodeprints(); + app.work.update_any_attrs(app.db); + app.work.maybe_update_inodeprints(app.db); if (!app.opts.branchname().empty()) app.make_branch_sticky(); @@ -624,12 +624,12 @@ CMD(merge_into_workspace, N_("tree"), // (revs can have no more than two parents). { parent_map parents; - app.work.get_parent_rosters(parents); + app.work.get_parent_rosters(parents, app.db); N(parents.size() == 1, F("this command can only be used in a single-parent workspace")); temp_node_id_source nis; - app.work.get_current_roster_shape(working_roster, nis); + app.work.get_current_roster_shape(working_roster, app.db, nis); app.work.update_current_roster_from_filesystem(working_roster); N(parent_roster(parents.begin()) == working_roster, @@ -683,10 +683,10 @@ CMD(merge_into_workspace, N_("tree"), make_cset(*left.first, merge_result.roster, update); // small race condition here... - app.work.perform_content_update(update, wca); + app.work.perform_content_update(update, wca, app.db); app.work.put_work_rev(merged_rev); - app.work.update_any_attrs(); - app.work.maybe_update_inodeprints(); + app.work.update_any_attrs(app.db); + app.work.maybe_update_inodeprints(app.db); P(F("updated to result of merge\n" " [left] %s\n" @@ -845,7 +845,7 @@ CMD(pluck, N_("workspace"), N_("[-r FROM // Get the WORKING roster roster_t working_roster; MM(working_roster); - app.work.get_current_roster_shape(working_roster, nis); + app.work.get_current_roster_shape(working_roster, app.db, nis); app.work.update_current_roster_from_filesystem(working_roster); @@ -895,7 +895,7 @@ CMD(pluck, N_("workspace"), N_("[-r FROM MM(update); make_cset(working_roster, merged_roster, update); E(!update.empty(), F("no changes were applied")); - app.work.perform_content_update(update, wca); + app.work.perform_content_update(update, wca, app.db); P(F("applied changes to workspace")); @@ -903,12 +903,12 @@ CMD(pluck, N_("workspace"), N_("[-r FROM parent_map parents; revision_t remaining; MM(remaining); - app.work.get_parent_rosters(parents); + app.work.get_parent_rosters(parents, app.db); make_revision_for_workspace(parents, merged_roster, remaining); // small race condition here... app.work.put_work_rev(remaining); - app.work.update_any_attrs(); + app.work.update_any_attrs(app.db); // add a note to the user log file about what we did { @@ -968,8 +968,8 @@ CMD(get_roster, N_("debug"), N_("[REVID] revision_id rid(fake_id()); app.require_workspace(); - app.work.get_parent_rosters(parents); - app.work.get_current_roster_shape(roster, nis); + app.work.get_parent_rosters(parents, app.db); + app.work.get_current_roster_shape(roster, app.db, nis); app.work.update_current_roster_from_filesystem(roster); if (parents.size() == 0) ============================================================ --- cmd_netsync.cc 3480dd77ea18cca0fe7842b0d4807f7e7183a76f +++ cmd_netsync.cc 46165ee435b96b6b4ec44c1c9e376a2ca8c06478 @@ -342,10 +342,10 @@ CMD(clone, N_("network"), N_("ADDRESS[:P content_merge_workspace_adaptor wca(app, empty_roster, paths); - app.work.perform_content_update(checkout, wca, false); + app.work.perform_content_update(checkout, wca, app.db, false); - app.work.update_any_attrs(); - app.work.maybe_update_inodeprints(); + app.work.update_any_attrs(app.db); + app.work.maybe_update_inodeprints(app.db); guard.commit(); remove_on_fail.commit(); } ============================================================ --- cmd_ws_commit.cc a58f8793fc0c9efff8699dd358922f6c7076f6d3 +++ cmd_ws_commit.cc ebec7449ba110d4c11c4442b655b549a8561e6d7 @@ -90,14 +90,14 @@ CMD(revert, N_("workspace"), N_("[PATH]. app.require_workspace(); parent_map parents; - app.work.get_parent_rosters(parents); + app.work.get_parent_rosters(parents, app.db); N(parents.size() == 1, F("this command can only be used in a single-parent workspace")); old_roster = parent_roster(parents.begin()); { temp_node_id_source nis; - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_current_roster_shape(new_roster, app.db, nis); } node_restriction mask(args_to_paths(args), @@ -203,8 +203,8 @@ CMD(revert, N_("workspace"), N_("[PATH]. // Race. app.work.put_work_rev(remaining); - app.work.update_any_attrs(); - app.work.maybe_update_inodeprints(); + app.work.update_any_attrs(app.db); + app.work.maybe_update_inodeprints(app.db); } CMD(disapprove, N_("review"), N_("REVISION"), @@ -303,7 +303,7 @@ CMD(mkdir, N_("workspace"), N_("[DIRECTO mkdir_p(file_path(*i)); } - app.work.perform_additions(paths, false, true); + app.work.perform_additions(paths, app.db, false, true); } CMD(add, N_("workspace"), N_("[PATH]..."), @@ -329,14 +329,15 @@ CMD(add, N_("workspace"), N_("[PATH]..." if (roots.empty()) roots.push_back(file_path()); - app.work.find_unknown_and_ignored(mask, roots, paths, ignored); + app.work.find_unknown_and_ignored(mask, roots, paths, ignored, app.db); - app.work.perform_additions(ignored, add_recursive, !app.opts.no_ignore); + app.work.perform_additions(ignored, app.db, + add_recursive, !app.opts.no_ignore); } else split_paths(args_to_paths(args), paths); - app.work.perform_additions(paths, add_recursive, !app.opts.no_ignore); + app.work.perform_additions(paths, app.db, add_recursive, !app.opts.no_ignore); } CMD(drop, N_("workspace"), N_("[PATH]..."), @@ -353,7 +354,7 @@ CMD(drop, N_("workspace"), N_("[PATH]... { temp_node_id_source nis; roster_t current_roster_shape; - app.work.get_current_roster_shape(current_roster_shape, nis); + app.work.get_current_roster_shape(current_roster_shape, app.db, nis); node_restriction mask(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), app.opts.depth, @@ -363,7 +364,8 @@ CMD(drop, N_("workspace"), N_("[PATH]... else split_paths(args_to_paths(args), paths); - app.work.perform_deletions(paths, app.opts.recursive, app.opts.bookkeep_only); + app.work.perform_deletions(paths, app.db, + app.opts.recursive, app.opts.bookkeep_only); } ALIAS(rm, drop); @@ -388,7 +390,7 @@ CMD(rename, N_("workspace"), file_path s = file_path_external(idx(args, i)); src_paths.insert(s); } - app.work.perform_rename(src_paths, dst_path, app.opts.bookkeep_only); + app.work.perform_rename(src_paths, dst_path, app.db, app.opts.bookkeep_only); } ALIAS(mv, rename); @@ -410,7 +412,8 @@ CMD(pivot_root, N_("workspace"), N_("NEW app.require_workspace(); file_path new_root = file_path_external(idx(args, 0)); file_path put_old = file_path_external(idx(args, 1)); - app.work.perform_pivot_root(new_root, put_old, app.opts.bookkeep_only); + app.work.perform_pivot_root(new_root, put_old, app.db, + app.opts.bookkeep_only); } CMD(status, N_("informative"), N_("[PATH]..."), N_("show status of workspace"), @@ -422,8 +425,8 @@ CMD(status, N_("informative"), N_("[PATH temp_node_id_source nis; app.require_workspace(); - app.work.get_parent_rosters(old_rosters); - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_parent_rosters(old_rosters, app.db); + app.work.get_current_roster_shape(new_roster, app.db, nis); node_restriction mask(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), @@ -585,10 +588,10 @@ CMD(checkout, N_("tree"), N_("[DIRECTORY content_merge_workspace_adaptor wca(app, empty_roster, paths); - app.work.perform_content_update(checkout, wca, false); + app.work.perform_content_update(checkout, wca, app.db, false); - app.work.update_any_attrs(); - app.work.maybe_update_inodeprints(); + app.work.update_any_attrs(app.db); + app.work.maybe_update_inodeprints(app.db); guard.commit(); } @@ -605,7 +608,7 @@ CMD(attr, N_("workspace"), N_("set PATH temp_node_id_source nis; app.require_workspace(); - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_current_roster_shape(new_roster, app.db, nis); file_path path = file_path_external(idx(args,1)); split_path sp; @@ -649,12 +652,12 @@ CMD(attr, N_("workspace"), N_("set PATH } parent_map parents; - app.work.get_parent_rosters(parents); + app.work.get_parent_rosters(parents, app.db); revision_t new_work; make_revision_for_workspace(parents, new_roster, new_work); app.work.put_work_rev(new_work); - app.work.update_any_attrs(); + app.work.update_any_attrs(app.db); } else if (subcmd == "get") { @@ -717,8 +720,8 @@ CMD(commit, N_("workspace"), N_("[PATH]. } app.make_branch_sticky(); - app.work.get_parent_rosters(old_rosters); - app.work.get_current_roster_shape(new_roster, nis); + app.work.get_parent_rosters(old_rosters, app.db); + app.work.get_current_roster_shape(new_roster, app.db, nis); node_restriction mask(args_to_paths(args), args_to_paths(app.opts.exclude_patterns), @@ -918,8 +921,8 @@ CMD(commit, N_("workspace"), N_("[PATH]. % ui.prog_name); } - app.work.update_any_attrs(); - app.work.maybe_update_inodeprints(); + app.work.update_any_attrs(app.db); + app.work.maybe_update_inodeprints(app.db); { // Tell lua what happened. Yes, we might lose some information @@ -1088,7 +1091,7 @@ CMD(refresh_inodeprints, N_("tree"), "", { app.require_workspace(); app.work.enable_inodeprints(); - app.work.maybe_update_inodeprints(); + app.work.maybe_update_inodeprints(app.db); } ============================================================ --- work.cc 923e55fbbdefb8123ad42a101809a017a6a86188 +++ work.cc 87e512a4354848adfe6fcfba64a24ec1e9fdcff7 @@ -140,13 +140,14 @@ void } void -workspace::get_parent_rosters(parent_map & parents) +workspace::get_parent_rosters(parent_map & parents, database & db) { revision_t rev; get_work_rev(rev); parents.clear(); - for (edge_map::const_iterator i = rev.edges.begin(); i != rev.edges.end(); i++) + for (edge_map::const_iterator i = rev.edges.begin(); + i != rev.edges.end(); i++) { database::cached_roster cr; get_roster_for_rid(edge_old_revision(i), cr, db); @@ -155,7 +156,8 @@ void } void -workspace::get_current_roster_shape(roster_t & ros, node_id_source & nis) +workspace::get_current_roster_shape(roster_t & ros, database & db, + node_id_source & nis) { revision_t rev; get_work_rev(rev); @@ -405,7 +407,7 @@ void } void -workspace::maybe_update_inodeprints() +workspace::maybe_update_inodeprints(database & db) { if (!in_inodeprints_mode()) return; @@ -414,11 +416,11 @@ workspace::maybe_update_inodeprints() temp_node_id_source nis; roster_t new_roster; - get_current_roster_shape(new_roster, nis); + get_current_roster_shape(new_roster, db, nis); update_current_roster_from_filesystem(new_roster); parent_map parents; - get_parent_rosters(parents); + get_parent_rosters(parents, db); node_map const & new_nodes = new_roster.all_nodes(); for (node_map::const_iterator i = new_nodes.begin(); i != new_nodes.end(); ++i) @@ -1249,13 +1251,14 @@ workspace::find_unknown_and_ignored(path void workspace::find_unknown_and_ignored(path_restriction const & mask, vector const & roots, - path_set & unknown, path_set & ignored) + path_set & unknown, path_set & ignored, + database & db) { path_set known; roster_t new_roster; temp_node_id_source nis; - get_current_roster_shape(new_roster, nis); + get_current_roster_shape(new_roster, db, nis); new_roster.extract_path_set(known); @@ -1268,7 +1271,7 @@ void } void -workspace::perform_additions(path_set const & paths, +workspace::perform_additions(path_set const & paths, database & db, bool recursive, bool respect_ignore) { if (paths.empty()) @@ -1277,7 +1280,7 @@ workspace::perform_additions(path_set co temp_node_id_source nis; roster_t new_roster; MM(new_roster); - get_current_roster_shape(new_roster, nis); + get_current_roster_shape(new_roster, db, nis); editable_roster_base er(new_roster, nis); @@ -1319,12 +1322,12 @@ workspace::perform_additions(path_set co } parent_map parents; - get_parent_rosters(parents); + get_parent_rosters(parents, db); revision_t new_work; make_revision_for_workspace(parents, new_roster, new_work); put_work_rev(new_work); - update_any_attrs(); + update_any_attrs(db); } static bool @@ -1342,7 +1345,7 @@ void } void -workspace::perform_deletions(path_set const & paths, +workspace::perform_deletions(path_set const & paths, database & db, bool recursive, bool bookkeep_only) { if (paths.empty()) @@ -1351,10 +1354,10 @@ workspace::perform_deletions(path_set co temp_node_id_source nis; roster_t new_roster; MM(new_roster); - get_current_roster_shape(new_roster, nis); + get_current_roster_shape(new_roster, db, nis); parent_map parents; - get_parent_rosters(parents); + get_parent_rosters(parents, db); // we traverse the the paths backwards, so that we always hit deep paths // before shallow paths (because path_set is lexicographically sorted). @@ -1429,12 +1432,13 @@ workspace::perform_deletions(path_set co revision_t new_work; make_revision_for_workspace(parents, new_roster, new_work); put_work_rev(new_work); - update_any_attrs(); + update_any_attrs(db); } void workspace::perform_rename(set const & src_paths, file_path const & dst_path, + database & db, bool bookkeep_only) { temp_node_id_source nis; @@ -1446,7 +1450,7 @@ workspace::perform_rename(set I(!src_paths.empty()); - get_current_roster_shape(new_roster, nis); + get_current_roster_shape(new_roster, db, nis); dst_path.split(dst); @@ -1519,7 +1523,7 @@ workspace::perform_rename(set } parent_map parents; - get_parent_rosters(parents); + get_parent_rosters(parents, db); revision_t new_work; make_revision_for_workspace(parents, new_roster, new_work); @@ -1554,12 +1558,13 @@ workspace::perform_rename(set } } } - update_any_attrs(); + update_any_attrs(db); } void workspace::perform_pivot_root(file_path const & new_root, file_path const & put_old, + database & db, bool bookkeep_only) { split_path new_root_sp, put_old_sp, root_sp; @@ -1570,7 +1575,7 @@ workspace::perform_pivot_root(file_path temp_node_id_source nis; roster_t new_roster; MM(new_roster); - get_current_roster_shape(new_roster, nis); + get_current_roster_shape(new_roster, db, nis); I(new_roster.has_root()); N(new_roster.has_node(new_root_sp), @@ -1611,7 +1616,7 @@ workspace::perform_pivot_root(file_path { parent_map parents; - get_parent_rosters(parents); + get_parent_rosters(parents, db); revision_t new_work; make_revision_for_workspace(parents, new_roster, new_work); @@ -1620,14 +1625,15 @@ workspace::perform_pivot_root(file_path if (!bookkeep_only) { content_merge_empty_adaptor cmea; - perform_content_update(cs, cmea); + perform_content_update(cs, cmea, db); } - update_any_attrs(); + update_any_attrs(db); } void workspace::perform_content_update(cset const & update, content_merge_adaptor const & ca, + database & db, bool const messages) { roster_t roster; @@ -1641,7 +1647,7 @@ workspace::perform_content_update(cset c "you must clean up and remove the %s directory") % detached); - get_current_roster_shape(new_roster, nis); + get_current_roster_shape(new_roster, db, nis); new_roster.extract_path_set(known); workspace_itemizer itemizer(roster, known, nis); @@ -1659,11 +1665,11 @@ void } void -workspace::update_any_attrs() +workspace::update_any_attrs(database & db) { temp_node_id_source nis; roster_t new_roster; - get_current_roster_shape(new_roster, nis); + get_current_roster_shape(new_roster, db, nis); node_map const & nodes = new_roster.all_nodes(); for (node_map::const_iterator i = nodes.begin(); i != nodes.end(); ++i) ============================================================ --- work.hh 8797491e6dd9884bbbb4a76dc00e87b5dfd9f7f9 +++ work.hh f7dac1c4950fd46cd98ca8a36e3da2eddf7ec04b @@ -66,6 +66,7 @@ class lua_hooks; class node_restriction; struct content_merge_adaptor; class lua_hooks; +class database; struct workspace { @@ -75,28 +76,33 @@ struct workspace void find_unknown_and_ignored(path_restriction const & mask, std::vector const & roots, - path_set & unknown, path_set & ignored); + path_set & unknown, path_set & ignored, + database & db); void perform_additions(path_set const & targets, + database & db, bool recursive = false, bool respect_ignore = true); - void perform_deletions(path_set const & targets, bool recursive, - bool bookkeep_only); + void perform_deletions(path_set const & targets, database & db, + bool recursive, bool bookkeep_only); void perform_rename(std::set const & src_paths, file_path const & dst_dir, + database & db, bool bookkeep_only); void perform_pivot_root(file_path const & new_root, file_path const & put_old, + database & db, bool bookkeep_only); void perform_content_update(cset const & cs, content_merge_adaptor const & ca, + database & db, bool messages = true); - void update_any_attrs(); + void update_any_attrs(database &); // write out a new (partial) revision describing the current workspace; @@ -116,12 +122,13 @@ struct workspace // hashes, call update_current_roster_from_filesystem on the result of // this function. Under almost all conditions, NIS should be a // temp_node_id_source. - void get_current_roster_shape(roster_t & ros, node_id_source & nis); + void get_current_roster_shape(roster_t & ros, + database & db, node_id_source & nis); // This returns a map whose keys are revision_ids and whose values are // rosters, there being one such pair for each parent of the current // revision. - void get_parent_rosters(parent_map & parents); + void get_parent_rosters(parent_map & parents, database & db); // Inspect the workspace and classify all the paths in it according to // what ROS thinks of them. @@ -195,13 +202,12 @@ struct workspace // the 'inodeprints file' contains inode fingerprints void enable_inodeprints(); - void maybe_update_inodeprints(); + void maybe_update_inodeprints(database &); - // constructor and locals. by caching pointers to the database and the + // constructor and locals. by caching pointers to the // lua hooks, we don't have to know about app_state. - workspace(database & db, lua_hooks & lua) : db(db), lua(lua) {}; + workspace(lua_hooks & lua) : lua(lua) {}; private: - database & db; lua_hooks & lua; };