Let's use the new API
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | rust/hg-core/src/dirstate_tree/dirstate_map.rs (8 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
cf8b477f2378 | 58d03a52ef44 | Raphaël Gomès | Tue, Apr 12, 11:30 AM |
Status | Author | Revision | |
---|---|---|---|
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare | ||
Needs Review | Alphare |
pub fn has_tracked_dir( | pub fn has_tracked_dir( | ||||
&mut self, | &mut self, | ||||
directory: &HgPath, | directory: &HgPath, | ||||
) -> Result<bool, DirstateError> { | ) -> Result<bool, DirstateError> { | ||||
self.with_dmap_mut(|map| { | self.with_dmap_mut(|map| { | ||||
if let Some(node) = map.get_node(directory)? { | if let Some(node) = map.get_node(directory)? { | ||||
// A node without a `DirstateEntry` was created to hold child | // A node without a `DirstateEntry` was created to hold child | ||||
// nodes, and is therefore a directory. | // nodes, and is therefore a directory. | ||||
let state = node.state()?; | let is_dir = node.entry()?.is_none(); | ||||
Ok(state.is_none() && node.tracked_descendants_count() > 0) | Ok(is_dir && node.tracked_descendants_count() > 0) | ||||
} else { | } else { | ||||
Ok(false) | Ok(false) | ||||
} | } | ||||
}) | }) | ||||
} | } | ||||
pub fn has_dir( | pub fn has_dir( | ||||
&mut self, | &mut self, | ||||
directory: &HgPath, | directory: &HgPath, | ||||
) -> Result<bool, DirstateError> { | ) -> Result<bool, DirstateError> { | ||||
self.with_dmap_mut(|map| { | self.with_dmap_mut(|map| { | ||||
if let Some(node) = map.get_node(directory)? { | if let Some(node) = map.get_node(directory)? { | ||||
// A node without a `DirstateEntry` was created to hold child | // A node without a `DirstateEntry` was created to hold child | ||||
// nodes, and is therefore a directory. | // nodes, and is therefore a directory. | ||||
let state = node.state()?; | let is_dir = node.entry()?.is_none(); | ||||
Ok(state.is_none() && node.descendants_with_entry_count() > 0) | Ok(is_dir && node.descendants_with_entry_count() > 0) | ||||
} else { | } else { | ||||
Ok(false) | Ok(false) | ||||
} | } | ||||
}) | }) | ||||
} | } | ||||
#[timed] | #[timed] | ||||
pub fn pack_v1( | pub fn pack_v1( |