# # # patch "roster_merge.cc" # from [3e750304ce9a32dfc133335060911ae4952fc2cb] # to [8ab8f10fbf767897ff17f71c29a3c11a145b4b05] # ============================================================ --- roster_merge.cc 3e750304ce9a32dfc133335060911ae4952fc2cb +++ roster_merge.cc 8ab8f10fbf767897ff17f71c29a3c11a145b4b05 @@ -432,6 +432,32 @@ I(new_i == result.roster.all_nodes().end()); } - // FIXME: looped nodes here + // now check for the possible global problems + if (!result.roster.has_root()) + result.missing_root_dir = true; + else + { + // 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)) + { + illegal_name_conflict conflict; + node_t n = result.roster.get_node(split_mt); + conflict.nid = n->self; + conflict.parent_name.first = n->parent; + conflict.parent_name.second = n->name; + I(n->self == result.roster.detach_node(split_mt)); + result.illegal_name_conflicts.push_back(conflict); + } + } }