# # # patch "ChangeLog" # from [541d8b45be688cc8b46d698d34552067c2aab4a4] # to [aeb0e8e1ec082c76814bab24edafb56eb8536481] # # patch "work.cc" # from [265e6d058be85a58414c208164fbe9592b1d3e74] # to [a08b5b1fb78a4c8b31400df33b6aacab23ceee8f] # # patch "work.hh" # from [723c827976adf80b589df8c0e2629ed7fafb907e] # to [ac03773aaca77322a4f42edbfc71924f959a074c] # ============================================================ --- ChangeLog 541d8b45be688cc8b46d698d34552067c2aab4a4 +++ ChangeLog aeb0e8e1ec082c76814bab24edafb56eb8536481 @@ -1,5 +1,14 @@ 2006-02-19 Matthew Gregan + * work.hh (struct editable_working_tree): Add map for tracking + path name mappings across node detach operations. + + * work.cc (editable_working_tree::detach_node): Insert path name + mappings into map. + (editable_working_tree::drop_detached_node, + editable_working_tree::attach_node): Report add/drop/rename + operations during workspace updates. + * lua.cc: Use the safer luaL_check* rather than lua_to* in monotone_*_for_lua functions. ============================================================ --- work.cc 265e6d058be85a58414c208164fbe9592b1d3e74 +++ work.cc a08b5b1fb78a4c8b31400df33b6aacab23ceee8f @@ -755,6 +755,7 @@ node_id nid = next_nid++; file_path src_pth(src); bookkeeping_path dst_pth = path_for_nid(nid); + safe_insert(rename_add_drop_map, make_pair(dst_pth, src_pth)); make_dir_for(dst_pth); move_path(src_pth, dst_pth); return nid; @@ -764,6 +765,10 @@ editable_working_tree::drop_detached_node(node_id nid) { bookkeeping_path pth = path_for_nid(nid); + std::map::const_iterator i + = rename_add_drop_map.find(pth); + I(i != rename_add_drop_map.end()); + P(F("dropping %s") % i->second); delete_file_or_dir_shallow(pth); } @@ -812,6 +817,7 @@ if (i->second == dst_id) return; } + P(F("adding %s") % dst_pth); file_data dat; source.get_file_content(i->second, dat); write_localized_data(dst_pth, dat.inner(), app.lua); @@ -835,6 +841,12 @@ return; break; } + std::map::const_iterator i + = rename_add_drop_map.find(src_pth); + if (i != rename_add_drop_map.end()) + P(F("renaming %s to %s") % i->second % dst_pth); + else + P(F("adding %s") % dst_pth); // This will complain if the move is actually impossible move_path(src_pth, dst_pth); } ============================================================ --- work.hh 723c827976adf80b589df8c0e2629ed7fafb907e +++ work.hh ac03773aaca77322a4f42edbfc71924f959a074c @@ -182,6 +182,7 @@ struct editable_working_tree : public editable_tree { std::map written_content; + std::map rename_add_drop_map; editable_working_tree(app_state & app, file_content_source const & source); virtual node_id detach_node(split_path const & src);