# # patch "paths.cc" # from [b2e0c5b32c2e2b37e6051a23fc50f58b79fdced2] # to [79515041f699f1cb000e3561fda2fcc32b25e4d3] # # patch "paths.hh" # from [ea4ee8e37e6c0d93fddd24395ddc82b44e0c9cbb] # to [a00be5637d08e5e2cc4766283157449f188aa792] # # patch "roster.cc" # from [86fabe39ac8fcc3240c1c479d6e689d72453c4ea] # to [81fcd8d85341e00129020cc6183991b4887476e0] # # patch "tests/t_rename_dir_add_dir_with_old_name.at" # from [b005c1839d019fa629d02fa1373f391715937594] # to [20a0beb813e9b6231c13fada0408b1e876db7a3a] # ======================================================================== --- paths.cc b2e0c5b32c2e2b37e6051a23fc50f58b79fdced2 +++ paths.cc 79515041f699f1cb000e3561fda2fcc32b25e4d3 @@ -303,6 +303,30 @@ } } +void dump(split_path const & sp, std::string & out) +{ + std::ostringstream oss; + + for (split_path::const_iterator i = sp.begin(); i != sp.end(); ++i) + { + if (null_name(*i)) + oss << "."; + else + oss << "/" << pc_interner.lookup(*i); + } + + oss << "\n"; + + out = oss.str(); +} + +void dump(path_component const & pc, std::string & out) +{ + std::ostringstream oss; + oss << pc << " " << pc_interner.lookup(pc); + out = oss.str(); +} + /////////////////////////////////////////////////////////////////////////// // localizing file names (externalizing them) // this code must be superfast when there is no conversion needed ======================================================================== --- paths.hh ea4ee8e37e6c0d93fddd24395ddc82b44e0c9cbb +++ paths.hh a00be5637d08e5e2cc4766283157449f188aa792 @@ -118,6 +118,9 @@ return pc == the_null_component; } +void dump(split_path const & sp, std::string & out); +void dump(path_component const & pc, std::string & out); + // It's possible this will become a proper virtual interface in the future, // but since the implementation is exactly the same in all cases, there isn't // much point ATM... ======================================================================== --- roster.cc 86fabe39ac8fcc3240c1c479d6e689d72453c4ea +++ roster.cc 81fcd8d85341e00129020cc6183991b4887476e0 @@ -235,10 +235,12 @@ dump(node_t const & n, std::string & out) { std::ostringstream oss; + std::string name; + dump(n->name, name); oss << "address: " << n << " (uses: " << n.use_count() << ")\n" << "self: " << n->self << "\n" << "parent: " << n->parent << "\n" - << "name: " << n->name << "\n"; + << "name: " << name << "\n"; std::string attr_map_s; dump(n->attrs, attr_map_s); oss << "attrs:\n" << attr_map_s; @@ -252,7 +254,10 @@ dir_map const & c = downcast_to_dir_t(n)->children; oss << "children: " << c.size() << "\n"; for (dir_map::const_iterator i = c.begin(); i != c.end(); ++i) - oss << " " << i->first << " -> " << i->second << "\n"; + { + dump(i->first, name); + oss << " " << name << " -> " << i->second << "\n"; + } } out = oss.str(); } @@ -500,6 +505,9 @@ return root_dir; } + MM(sp); + MM(*this); + I(has_root()); dir_t d = root_dir; for (split_path::const_iterator i = dirname.begin()+1; i != dirname.end(); ++i) @@ -677,6 +685,8 @@ path_component basename; dirname_basename(dst, dirname, basename); + MM(dst); + if (dirname.empty()) // attaching the root node attach_node(nid, the_null_node, basename); @@ -908,6 +918,8 @@ editable_roster_base::attach_node(node_id nid, split_path const & dst) { // L(F("attach_node(%d, '%s')") % nid % file_path(dst)); + MM(dst); + MM(this->r); r.attach_node(nid, dst); } ======================================================================== --- tests/t_rename_dir_add_dir_with_old_name.at b005c1839d019fa629d02fa1373f391715937594 +++ tests/t_rename_dir_add_dir_with_old_name.at 20a0beb813e9b6231c13fada0408b1e876db7a3a @@ -1,12 +1,9 @@ # -*- Autoconf -*- AT_SETUP([renaming a directory and then adding a new with the old name]) MONOTONE_SETUP -# This test is a bug report. -AT_XFAIL_IF(true) - # add 'foo/test' file AT_CHECK(mkdir foo) AT_DATA(foo/test, [test file in foo dir