Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | rust/hg-core/src/dirstate_tree/dirstate_map.rs (13 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
344856b63764 | 41044470a3a7 | Raphaël Gomès | Tue, Apr 12, 11:35 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 |
use crate::dirstate::TruncatedTimestamp; | use crate::dirstate::TruncatedTimestamp; | ||||
use crate::matchers::Matcher; | use crate::matchers::Matcher; | ||||
use crate::utils::hg_path::{HgPath, HgPathBuf}; | use crate::utils::hg_path::{HgPath, HgPathBuf}; | ||||
use crate::DirstateEntry; | use crate::DirstateEntry; | ||||
use crate::DirstateError; | use crate::DirstateError; | ||||
use crate::DirstateMapError; | use crate::DirstateMapError; | ||||
use crate::DirstateParents; | use crate::DirstateParents; | ||||
use crate::DirstateStatus; | use crate::DirstateStatus; | ||||
use crate::EntryState; | |||||
use crate::FastHashbrownMap as FastHashMap; | use crate::FastHashbrownMap as FastHashMap; | ||||
use crate::PatternFileWarning; | use crate::PatternFileWarning; | ||||
use crate::StatusError; | use crate::StatusError; | ||||
use crate::StatusOptions; | use crate::StatusOptions; | ||||
/// Append to an existing data file if the amount of unreachable data (not used | /// Append to an existing data file if the amount of unreachable data (not used | ||||
/// anymore) is less than this fraction of the total amount of existing data. | /// anymore) is less than this fraction of the total amount of existing data. | ||||
const ACCEPTABLE_UNREACHABLE_BYTES_RATIO: f32 = 0.5; | const ACCEPTABLE_UNREACHABLE_BYTES_RATIO: f32 = 0.5; | ||||
match self { | match self { | ||||
NodeRef::InMemory(_path, node) => { | NodeRef::InMemory(_path, node) => { | ||||
Ok(node.data.as_entry().copied()) | Ok(node.data.as_entry().copied()) | ||||
} | } | ||||
NodeRef::OnDisk(node) => node.entry(), | NodeRef::OnDisk(node) => node.entry(), | ||||
} | } | ||||
} | } | ||||
pub(super) fn state( | |||||
&self, | |||||
) -> Result<Option<EntryState>, DirstateV2ParseError> { | |||||
Ok(self.entry()?.and_then(|e| { | |||||
if e.any_tracked() { | |||||
Some(e.state()) | |||||
} else { | |||||
None | |||||
} | |||||
})) | |||||
} | |||||
pub(super) fn cached_directory_mtime( | pub(super) fn cached_directory_mtime( | ||||
&self, | &self, | ||||
) -> Result<Option<TruncatedTimestamp>, DirstateV2ParseError> { | ) -> Result<Option<TruncatedTimestamp>, DirstateV2ParseError> { | ||||
match self { | match self { | ||||
NodeRef::InMemory(_path, node) => Ok(match node.data { | NodeRef::InMemory(_path, node) => Ok(match node.data { | ||||
NodeData::CachedDirectory { mtime } => Some(mtime), | NodeData::CachedDirectory { mtime } => Some(mtime), | ||||
_ => None, | _ => None, | ||||
}), | }), |