# # # patch "ChangeLog" # from [2e52450b045428647fd2c86dbe6be7c00d4ce2fb] # to [b0091dbc729c1bec0240ee0ba7fffcb34af27651] # # patch "roster.cc" # from [53fa86f25f6c972e36ae212a85597212a85dd5ab] # to [d2dc2cd53a82612ee879acf9876daa7c03470526] # # patch "roster.hh" # from [e066e66795e21670af3208b907e34702abf4b59e] # to [4311630daf983b04c2e466df0432f204242c13a5] # # patch "roster_merge.cc" # from [bb397689fd7f7a1c32d0bb68e838bf5a90fda537] # to [07988550bd447a95fb3bb6dd52816364c60caa62] # ============================================================ --- ChangeLog 2e52450b045428647fd2c86dbe6be7c00d4ce2fb +++ ChangeLog b0091dbc729c1bec0240ee0ba7fffcb34af27651 @@ -1,5 +1,10 @@ 2006-02-19 Nathaniel Smith + * roster.cc (shallow_equal): Publically expose. + * roster.cc, roster_merge.cc: Various compile fixes. + +2006-02-19 Nathaniel Smith + * roster_merge.{hh,cc}: Make terminology more consistent. "marking_map" type -> "markings" name, "marking_t" type -> "marking" name. ============================================================ --- roster.cc 53fa86f25f6c972e36ae212a85597212a85dd5ab +++ roster.cc d2dc2cd53a82612ee879acf9876daa7c03470526 @@ -2877,7 +2877,7 @@ } }; -testing_node_id_source() +testing_node_id_source::testing_node_id_source() : curr(first_node) {} ============================================================ --- roster.hh e066e66795e21670af3208b907e34702abf4b59e +++ roster.hh 4311630daf983b04c2e466df0432f204242c13a5 @@ -143,6 +143,9 @@ return f; } +bool +shallow_equal(node_t a, node_t b, bool shallow_compare_dir_children); + template <> void dump(node_t const & n, std::string & out); struct marking_t ============================================================ --- roster_merge.cc bb397689fd7f7a1c32d0bb68e838bf5a90fda537 +++ roster_merge.cc 07988550bd447a95fb3bb6dd52816364c60caa62 @@ -622,7 +622,7 @@ marking_t marking; marking.birth_revision = birth_rid; marking.parent_name.insert(parent_name_rid); - marking.contain.file_content.insert(file_content_rid); + marking.file_content.insert(file_content_rid); safe_insert(markings, std::make_pair(nid, marking)); } @@ -632,7 +632,7 @@ node_id & safe_dir_nid, node_id & safe_file_nid, node_id_source & nis) { make_dir(r, markings, common1, common1, name + "_old_dir", common_dir_nid); - make_file(r, markings, common1, common1, name + "_old_file", common_file_nid); + make_file(r, markings, common1, common1, common1, name + "_old_file", fid1, common_file_nid); safe_dir_nid = nis.next(); make_dir(r, markings, uncommon, uncommon, name + "_safe_dir", safe_dir_nid); safe_file_nid = nis.next(); @@ -671,18 +671,26 @@ // do the merge roster_merge_result result; roster_merge(a_roster, a_markings, a_uncommon, b_roster, b_markings, b_uncommon, result); - I(result.clean()); + I(result.is_clean()); // 7 = 1 root + 2 common + 2 safe a + 2 safe b I(result.roster.all_nodes().size() == 7); // check that they're the right ones... - I(*result.roster.get_node(common_dir_nid) == *a_roster.get_node(common_dir_nid)); - I(*result.roster.get_node(common_file_nid) == *a_roster.get_node(common_file_nid)); - I(*result.roster.get_node(common_dir_nid) == *b_roster.get_node(common_dir_nid)); - I(*result.roster.get_node(common_file_nid) == *b_roster.get_node(common_file_nid)); - I(*result.roster.get_node(a_safe_dir_nid) == *a_roster.get_node(a_safe_dir_nid)); - I(*result.roster.get_node(a_safe_file_nid) == *a_roster.get_node(a_safe_file_nid)); - I(*result.roster.get_node(b_safe_dir_nid) == *b_roster.get_node(b_safe_dir_nid)); - I(*result.roster.get_node(b_safe_file_nid) == *b_roster.get_node(b_safe_file_nid)); + I(shallow_equal(result.roster.get_node(common_dir_nid), + a_roster.get_node(common_dir_nid), false)); + I(shallow_equal(result.roster.get_node(common_file_nid), + a_roster.get_node(common_file_nid), false)); + I(shallow_equal(result.roster.get_node(common_dir_nid), + b_roster.get_node(common_dir_nid), false)); + I(shallow_equal(result.roster.get_node(common_file_nid), + b_roster.get_node(common_file_nid), false)); + I(shallow_equal(result.roster.get_node(a_safe_dir_nid), + a_roster.get_node(a_safe_dir_nid), false)); + I(shallow_equal(result.roster.get_node(a_safe_file_nid), + a_roster.get_node(a_safe_file_nid), false)); + I(shallow_equal(result.roster.get_node(b_safe_dir_nid), + b_roster.get_node(b_safe_dir_nid), false)); + I(shallow_equal(result.roster.get_node(b_safe_file_nid), + b_roster.get_node(b_safe_file_nid), false)); } void