rust/hg-core/src/dirstate_tree/dirstate_map.rs
changeset 49140 748ac6400eaa
parent 49136 3f5e207f78be
child 49143 e55ce61891e3
equal deleted inserted replaced
49139:7241b3721ba5 49140:748ac6400eaa
  1180     ) -> Result<bool, DirstateError> {
  1180     ) -> Result<bool, DirstateError> {
  1181         self.with_dmap_mut(|map| {
  1181         self.with_dmap_mut(|map| {
  1182             if let Some(node) = map.get_node(directory)? {
  1182             if let Some(node) = map.get_node(directory)? {
  1183                 // A node without a `DirstateEntry` was created to hold child
  1183                 // A node without a `DirstateEntry` was created to hold child
  1184                 // nodes, and is therefore a directory.
  1184                 // nodes, and is therefore a directory.
  1185                 let state = node.state()?;
  1185                 let is_dir = node.entry()?.is_none();
  1186                 Ok(state.is_none() && node.tracked_descendants_count() > 0)
  1186                 Ok(is_dir && node.tracked_descendants_count() > 0)
  1187             } else {
  1187             } else {
  1188                 Ok(false)
  1188                 Ok(false)
  1189             }
  1189             }
  1190         })
  1190         })
  1191     }
  1191     }
  1196     ) -> Result<bool, DirstateError> {
  1196     ) -> Result<bool, DirstateError> {
  1197         self.with_dmap_mut(|map| {
  1197         self.with_dmap_mut(|map| {
  1198             if let Some(node) = map.get_node(directory)? {
  1198             if let Some(node) = map.get_node(directory)? {
  1199                 // A node without a `DirstateEntry` was created to hold child
  1199                 // A node without a `DirstateEntry` was created to hold child
  1200                 // nodes, and is therefore a directory.
  1200                 // nodes, and is therefore a directory.
  1201                 let state = node.state()?;
  1201                 let is_dir = node.entry()?.is_none();
  1202                 Ok(state.is_none() && node.descendants_with_entry_count() > 0)
  1202                 Ok(is_dir && node.descendants_with_entry_count() > 0)
  1203             } else {
  1203             } else {
  1204                 Ok(false)
  1204                 Ok(false)
  1205             }
  1205             }
  1206         })
  1206         })
  1207     }
  1207     }