# # # patch "cmd_merging.cc" # from [58ea84cd757ce9a82b5735d19d77ba44181353fa] # to [9a47576c90f06ad185b9181e943cc6f979b8ef6c] # # patch "merge.cc" # from [777d0da01664da6d54c58a8149d1daa1f3e38dd5] # to [55a2014268f0503265fdb825d51a5603f6444da9] # # patch "roster_merge.cc" # from [bf1b4668fad36cfdc8778f3a49cf45e551a929de] # to [8dc405a91b63a0e9fd6f88750b172a9a2266514c] # # patch "roster_merge.hh" # from [f90b99f3bc483d29795a5449968d560f53f0a9c8] # to [9d15c76f67323e3aacd048d02a4496951a0d9fa8] # ============================================================ --- cmd_merging.cc 58ea84cd757ce9a82b5735d19d77ba44181353fa +++ cmd_merging.cc 9a47576c90f06ad185b9181e943cc6f979b8ef6c @@ -43,7 +43,8 @@ static void using boost::shared_ptr; static void -three_way_merge(revision_id const & ancestor_rid, roster_t const & ancestor_roster, +three_way_merge(database & db, + revision_id const & ancestor_rid, roster_t const & ancestor_roster, revision_id const & left_rid, roster_t const & left_roster, revision_id const & right_rid, roster_t const & right_roster, roster_merge_result & result, @@ -83,7 +84,7 @@ three_way_merge(revision_id const & ance P(F("[right] %s") % right_rid); // And do the merge - roster_merge(left_roster, left_markings, left_uncommon_ancestors, + roster_merge(db, left_roster, left_markings, left_uncommon_ancestors, right_roster, right_markings, right_uncommon_ancestors, result); } @@ -268,7 +269,7 @@ CMD(update, "update", "", CMD_REF(worksp // And finally do the merge roster_merge_result result; marking_map left_markings, right_markings; - three_way_merge(old_rid, *old_roster, + three_way_merge(db, old_rid, *old_roster, working_rid, *working_roster, chosen_rid, chosen_roster, result, left_markings, right_markings); @@ -626,7 +627,8 @@ CMD(merge_into_dir, "merge_into_dir", "" } roster_merge_result result; - roster_merge(left_roster, + roster_merge(db, + left_roster, left_marking_map, left_uncommon_ancestors, right_roster, @@ -737,7 +739,8 @@ CMD(merge_into_workspace, "merge_into_wo roster_merge_result merge_result; MM(merge_result); - roster_merge(*left.first, *left.second, left_uncommon_ancestors, + roster_merge(db, + *left.first, *left.second, left_uncommon_ancestors, *right.first, *right.second, right_uncommon_ancestors, merge_result); @@ -848,7 +851,8 @@ show_conflicts_core (database & db, revi set l_uncommon_ancestors, r_uncommon_ancestors; db.get_uncommon_ancestors(l_id, r_id, l_uncommon_ancestors, r_uncommon_ancestors); roster_merge_result result; - roster_merge(*l_roster, l_marking, l_uncommon_ancestors, + roster_merge(db, + *l_roster, l_marking, l_uncommon_ancestors, *r_roster, r_marking, r_uncommon_ancestors, result); @@ -1118,7 +1122,7 @@ CMD(pluck, "pluck", "", CMD_REF(workspac // Now do the merge roster_merge_result result; marking_map left_markings, right_markings; - three_way_merge(from_rid, *from_roster, + three_way_merge(db, from_rid, *from_roster, working_rid, *working_roster, to_rid, *to_roster, result, left_markings, right_markings); ============================================================ --- merge.cc 777d0da01664da6d54c58a8149d1daa1f3e38dd5 +++ merge.cc 55a2014268f0503265fdb825d51a5603f6444da9 @@ -199,7 +199,8 @@ interactive_merge_and_store(lua_hooks & roster_merge_result result; - roster_merge(left_roster, left_marking_map, left_uncommon_ancestors, + roster_merge(db, + left_roster, left_marking_map, left_uncommon_ancestors, right_roster, right_marking_map, right_uncommon_ancestors, result); ============================================================ --- roster_merge.cc bf1b4668fad36cfdc8778f3a49cf45e551a929de +++ roster_merge.cc 8dc405a91b63a0e9fd6f88750b172a9a2266514c @@ -1528,7 +1528,7 @@ namespace // or if we have a conflict. inline void - mark_merge_existence(node_t const & n, + mark_merge_existence(database & db, node_t const & n, marking_map const & live_markings, set const & live_uncommon_ancestors, roster_t const & live_parent_roster, @@ -1560,8 +1560,7 @@ namespace if (have_mark_in_live_uncommon_ancestor_set) { bool have_mark_in_dead_uncommon_ancestor_set = false; -#warning Need to get DB access in here -/* + // check for marks on the dead side... likely to be a little slow. for (set::const_iterator it = dead_uncommon_ancestors.begin(); it != dead_uncommon_ancestors.end(); it++) { @@ -1577,20 +1576,20 @@ namespace marking_map parent_markings; db.get_roster(*(parents.begin()), parent_roster, parent_markings); - if (!parent_roster.has_node(n)) + if (!parent_roster.has_node(n->self)) continue; roster_t rev_roster; marking_map rev_markings; db.get_roster(*it, rev_roster, rev_markings); - if (!rev_roster.has_node(n)) + if (!rev_roster.has_node(n->self)) { have_mark_in_dead_uncommon_ancestor_set = true; break; } } -*/ + if (have_mark_in_dead_uncommon_ancestor_set) { // marks on each side of the merge... conflict! @@ -1774,7 +1773,8 @@ void } // end anonymous namespace void -roster_merge(roster_t const & left_parent, +roster_merge(database & db, + roster_t const & left_parent, marking_map const & left_markings, set const & left_uncommon_ancestors, roster_t const & right_parent, @@ -1805,14 +1805,14 @@ roster_merge(roster_t const & left_paren I(false); case parallel::in_left: - mark_merge_existence(i.left_data(), + mark_merge_existence(db, i.left_data(), left_markings, left_uncommon_ancestors, left_parent, right_uncommon_ancestors, right_parent, result); break; case parallel::in_right: - mark_merge_existence(i.right_data(), + mark_merge_existence(db, i.right_data(), right_markings, right_uncommon_ancestors, right_parent, left_uncommon_ancestors, left_parent, result); ============================================================ --- roster_merge.hh f90b99f3bc483d29795a5449968d560f53f0a9c8 +++ roster_merge.hh 9d15c76f67323e3aacd048d02a4496951a0d9fa8 @@ -216,7 +216,8 @@ void template <> void dump(roster_merge_result const & result, std::string & out); void -roster_merge(roster_t const & left_parent, +roster_merge(database & db, + roster_t const & left_parent, marking_map const & left_markings, std::set const & left_uncommon_ancestors, roster_t const & right_parent,