# # # patch "paths.cc" # from [a88d2a803ce9e069bd8b0b6d5db4d2c2593de689] # to [412c32d13ea60209f80302123227ec5e89f329b1] # # patch "paths.hh" # from [f61b1b0f8a6fe9f4b6a55ff1a5513412856cb75c] # to [88fb66a29cde9fd89272dd0b24c72e49272a7a58] # # patch "roster_merge.cc" # from [8ab8f10fbf767897ff17f71c29a3c11a145b4b05] # to [3ce493a493e3bcc05c87f8d360b1baff13239d7f] # ============================================================ --- paths.cc a88d2a803ce9e069bd8b0b6d5db4d2c2593de689 +++ paths.cc 412c32d13ea60209f80302123227ec5e89f329b1 @@ -76,6 +76,7 @@ static access_tracker working_root; bookkeeping_path const bookkeeping_root("MT"); +path_component const bookkeeping_root_component("MT"); void save_initial_path() @@ -825,6 +826,7 @@ split_path split_mt1, split_mt2; file_path_internal("foo/MT").split(split_mt1); BOOST_CHECK(split_mt1.size() == 3); + I(split_mt1[2] == bookkeeping_root_component); split_mt2.push_back(the_null_component); split_mt2.push_back(split_mt1[2]); // split_mt2 now contains the component "MT" ============================================================ --- paths.hh f61b1b0f8a6fe9f4b6a55ff1a5513412856cb75c +++ paths.hh 88fb66a29cde9fd89272dd0b24c72e49272a7a58 @@ -207,6 +207,7 @@ }; extern bookkeeping_path const bookkeeping_root; +extern path_component const bookkeeping_root_component; // this will always be an absolute path class system_path : public any_path ============================================================ --- roster_merge.cc 8ab8f10fbf767897ff17f71c29a3c11a145b4b05 +++ roster_merge.cc 3ce493a493e3bcc05c87f8d360b1baff13239d7f @@ -439,22 +439,17 @@ { // we can't have an illegal MT dir unless we have a root node in the // first place... - // FIXME: this is an ugly hack - split_path split_foo_mt; - file_path foo_mt = file_path_internal("foo") / bookkeeping_root.as_internal(); - foo_mt.split(split_foo_mt); - I(split_foo_mt.size() == 3); - split_path split_mt; - split_mt.push_back(idx(split_foo_mt, 0)); - split_mt.push_back(idx(split_foo_mt, 2)); - // now split_mt = split("MT") - if (result.roster.has_node(split_mt)) + split_path bookkeeping_root_split; + bookkeeping_root_split.push_back(the_null_component); + bookkeeping_root_split.push_back(bookkeeping_root_component); + if (result.roster.has_node(bookkeeping_root_split)) { illegal_name_conflict conflict; - node_t n = result.roster.get_node(split_mt); + node_t n = result.roster.get_node(bookkeeping_root_split); conflict.nid = n->self; conflict.parent_name.first = n->parent; conflict.parent_name.second = n->name; + I(n->name == bookkeeping_root_component); I(n->self == result.roster.detach_node(split_mt)); result.illegal_name_conflicts.push_back(conflict); }