rust/hg-core/src/dirstate_tree/dirstate_map.rs
changeset 47193 47ccab19bf9f
parent 47192 1249eb9cc332
child 47280 1766130fe9ba
equal deleted inserted replaced
47192:1249eb9cc332 47193:47ccab19bf9f
   377                         .as_ref()
   377                         .as_ref()
   378                         .map_or(false, |entry| entry.state.is_tracked()),
   378                         .map_or(false, |entry| entry.state.is_tracked()),
   379                     had_entry: node.entry.take().is_some(),
   379                     had_entry: node.entry.take().is_some(),
   380                     had_copy_source: node.copy_source.take().is_some(),
   380                     had_copy_source: node.copy_source.take().is_some(),
   381                 };
   381                 };
   382                 // TODO: this leaves in the tree a "non-file" node. Should we
   382             }
   383                 // remove the node instead, together with ancestor nodes for
   383             // After recursion, for both leaf (rest_of_path is None) nodes and
   384                 // directories that become empty?
   384             // parent nodes, remove a node if it just became empty.
       
   385             if node.entry.is_none()
       
   386                 && node.copy_source.is_none()
       
   387                 && node.children.is_empty()
       
   388             {
       
   389                 nodes.remove(first_path_component);
   385             }
   390             }
   386             Some(dropped)
   391             Some(dropped)
   387         }
   392         }
   388 
   393 
   389         if let Some(dropped) = recur(&mut self.root, filename) {
   394         if let Some(dropped) = recur(&mut self.root, filename) {