# # # patch "file_io.cc" # from [b97d1e90999a507d904c984a04c276b80fb388e5] # to [5a5151f72c1d0749834fe99ab0a2664fab90d5b2] # # patch "file_io.hh" # from [95244031bc7f0bc2a50de9998ee4543a9070ba53] # to [362691f10f63d93e7cf83f299fe5aa0b4dcbee17] # # patch "work.cc" # from [e55514ea245861a8739eb40cb120afe12c99ad6e] # to [d8560ef4eb2480bff500b9230a809810884bb444] # # patch "work.hh" # from [f65d7e425d5bc2fe38de8a2b17b7a437e0ee9c4e] # to [dc6f1035c0b3a27f9b94bff02d5f650b9da8f26b] # ============================================================ --- file_io.cc b97d1e90999a507d904c984a04c276b80fb388e5 +++ file_io.cc 5a5151f72c1d0749834fe99ab0a2664fab90d5b2 @@ -533,8 +533,8 @@ } if (fs::is_directory(entry)) { - if (walker.visit_dir(p)) - walk_tree_recursive(entry, rel_entry, walker); + walker.visit_dir(p); + walk_tree_recursive(entry, rel_entry, walker); } else { @@ -545,10 +545,9 @@ } } -bool +void tree_walker::visit_dir(file_path const & path) { - return true; } @@ -574,10 +573,10 @@ walker.visit_file(path); break; case path::directory: - if (walker.visit_dir(path)) - walk_tree_recursive(system_path(path).as_external(), - path.as_external(), - walker); + walker.visit_dir(path); + walk_tree_recursive(system_path(path).as_external(), + path.as_external(), + walker); break; } } ============================================================ --- file_io.hh 95244031bc7f0bc2a50de9998ee4543a9070ba53 +++ file_io.hh 362691f10f63d93e7cf83f299fe5aa0b4dcbee17 @@ -102,7 +102,7 @@ { public: // returns true if the directory should be descended into - virtual bool visit_dir(file_path const & path); + virtual void visit_dir(file_path const & path); virtual void visit_file(file_path const & path) = 0; virtual ~tree_walker(); }; ============================================================ --- work.cc e55514ea245861a8739eb40cb120afe12c99ad6e +++ work.cc d8560ef4eb2480bff500b9230a809810884bb444 @@ -28,11 +28,10 @@ string const attr_file_name(".mt-attrs"); -bool +void file_itemizer::visit_dir(file_path const & path) { this->visit_file(path); - return true; } void @@ -366,16 +365,16 @@ F("proposed new root directory '%s' is not versioned or does not exist") % new_root); { split_path new_root_MT; - (new_root / bookkeeping_root).split(new_root_MT); + (new_root / bookkeeping_root.as_internal()).split(new_root_MT); N(!new_roster.has_node(new_root_MT), F("proposed new root directory '%s' contains illegal path %s") % new_root % bookkeeping_root); } { - file_path current_path_to_put_old = (new_root / put_old); + file_path current_path_to_put_old = (new_root / put_old.as_internal()); split_path current_path_to_put_old_sp, current_path_to_put_old_parent_sp; path_component basename; - current_path_to_put_old.split(current_path_to_put_old); + current_path_to_put_old.split(current_path_to_put_old_sp); dirname_basename(current_path_to_put_old_sp, current_path_to_put_old_sp, basename); N(new_roster.has_node(current_path_to_put_old_parent_sp), F("directory '%s' is not versioned or does not exist") @@ -390,10 +389,17 @@ cset cs; safe_insert(cs.nodes_renamed, std::make_pair(root_sp, put_old_sp)); safe_insert(cs.nodes_renamed, std::make_pair(new_root_sp, root_sp)); - - cs.apply_to(editable_roster_base(new_roster, nis)); + + { + editable_roster_base e(new_roster, nis); + cs.apply_to(e); + } if (app.execute) - cs.apply_to(editable_working_tree(app, empty_file_content_source())); + { + empty_file_content_source efcs; + editable_working_tree e(app, efcs); + cs.apply_to(e); + } } ============================================================ --- work.hh f65d7e425d5bc2fe38de8a2b17b7a437e0ee9c4e +++ work.hh dc6f1035c0b3a27f9b94bff02d5f650b9da8f26b @@ -55,7 +55,7 @@ path_set & ignored; file_itemizer(app_state & a, path_set & k, path_set & u, path_set & i) : app(a), known(k), unknown(u), ignored(i) {} - virtual bool visit_dir(file_path const & path); + virtual void visit_dir(file_path const & path); virtual void visit_file(file_path const & path); };