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 |
rust/hg-cpython/src/dirstate/dirstate_map.rs | ||
---|---|---|
530 | Yeah that makes sense, will do. |
Path | Packages | |||
---|---|---|---|---|
M | rust/hg-core/src/dirstate/status.rs (3 lines) | |||
M | rust/hg-core/src/dirstate_tree.rs (1 line) | |||
M | rust/hg-core/src/dirstate_tree/dirstate_map.rs (12 lines) | |||
M | rust/hg-core/src/dirstate_tree/dispatch.rs (4 lines) | |||
A | M | rust/hg-core/src/dirstate_tree/status.rs (17 lines) | ||
M | rust/hg-cpython/src/dirstate/dirstate_map.rs (8 lines) | |||
M | rust/hg-cpython/src/dirstate/status.rs (2 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
ee2ddb8e8a67 | 64fd0751d5f2 | Simon Sapin | Apr 16 2021, 6:12 AM |
Status | Author | Revision | |
---|---|---|---|
Abandoned | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | SimonSapin |
was_file: bool, | was_file: bool, | ||||
}, | }, | ||||
} | } | ||||
type IoResult<T> = std::io::Result<T>; | type IoResult<T> = std::io::Result<T>; | ||||
/// `Box<dyn Trait>` is syntactic sugar for `Box<dyn Trait, 'static>`, so add | /// `Box<dyn Trait>` is syntactic sugar for `Box<dyn Trait, 'static>`, so add | ||||
/// an explicit lifetime here to not fight `'static` bounds "out of nowhere". | /// an explicit lifetime here to not fight `'static` bounds "out of nowhere". | ||||
type IgnoreFnType<'a> = Box<dyn for<'r> Fn(&'r HgPath) -> bool + Sync + 'a>; | pub type IgnoreFnType<'a> = | ||||
Box<dyn for<'r> Fn(&'r HgPath) -> bool + Sync + 'a>; | |||||
/// We have a good mix of owned (from directory traversal) and borrowed (from | /// We have a good mix of owned (from directory traversal) and borrowed (from | ||||
/// the dirstate/explicit) paths, this comes up a lot. | /// the dirstate/explicit) paths, this comes up a lot. | ||||
pub type HgPathCow<'a> = Cow<'a, HgPath>; | pub type HgPathCow<'a> = Cow<'a, HgPath>; | ||||
/// A path with its computed ``Dispatch`` information | /// A path with its computed ``Dispatch`` information | ||||
type DispatchedPath<'a> = (HgPathCow<'a>, Dispatch); | type DispatchedPath<'a> = (HgPathCow<'a>, Dispatch); | ||||
pub mod dirstate_map; | pub mod dirstate_map; | ||||
pub mod dispatch; | pub mod dispatch; | ||||
pub mod path_with_basename; | pub mod path_with_basename; | ||||
mod status; |
fn set_dirs(&mut self) -> Result<(), DirstateMapError> { | fn set_dirs(&mut self) -> Result<(), DirstateMapError> { | ||||
// Do nothing, this `DirstateMap` does not a separate `dirs` that needs | // Do nothing, this `DirstateMap` does not a separate `dirs` that needs | ||||
// to be recomputed | // to be recomputed | ||||
Ok(()) | Ok(()) | ||||
} | } | ||||
fn status<'a>( | fn status<'a>( | ||||
&'a self, | &'a mut self, | ||||
_matcher: &'a (dyn Matcher + Sync), | matcher: &'a (dyn Matcher + Sync), | ||||
_root_dir: PathBuf, | root_dir: PathBuf, | ||||
_ignore_files: Vec<PathBuf>, | ignore_files: Vec<PathBuf>, | ||||
_options: StatusOptions, | options: StatusOptions, | ||||
) -> Result<(DirstateStatus<'a>, Vec<PatternFileWarning>), StatusError> | ) -> Result<(DirstateStatus<'a>, Vec<PatternFileWarning>), StatusError> | ||||
{ | { | ||||
todo!() | super::status::status(self, matcher, root_dir, ignore_files, options) | ||||
} | } | ||||
fn copy_map_len(&self) -> usize { | fn copy_map_len(&self) -> usize { | ||||
self.nodes_with_copy_source_count | self.nodes_with_copy_source_count | ||||
} | } | ||||
fn copy_map_iter(&self) -> CopyMapIter<'_> { | fn copy_map_iter(&self) -> CopyMapIter<'_> { | ||||
Box::new(self.iter_nodes().filter_map(|(path, node)| { | Box::new(self.iter_nodes().filter_map(|(path, node)| { |
now: Timestamp, | now: Timestamp, | ||||
) -> Result<Vec<u8>, DirstateError>; | ) -> Result<Vec<u8>, DirstateError>; | ||||
fn set_all_dirs(&mut self) -> Result<(), DirstateMapError>; | fn set_all_dirs(&mut self) -> Result<(), DirstateMapError>; | ||||
fn set_dirs(&mut self) -> Result<(), DirstateMapError>; | fn set_dirs(&mut self) -> Result<(), DirstateMapError>; | ||||
fn status<'a>( | fn status<'a>( | ||||
&'a self, | &'a mut self, | ||||
matcher: &'a (dyn Matcher + Sync), | matcher: &'a (dyn Matcher + Sync), | ||||
root_dir: PathBuf, | root_dir: PathBuf, | ||||
ignore_files: Vec<PathBuf>, | ignore_files: Vec<PathBuf>, | ||||
options: StatusOptions, | options: StatusOptions, | ||||
) -> Result<(DirstateStatus<'a>, Vec<PatternFileWarning>), StatusError>; | ) -> Result<(DirstateStatus<'a>, Vec<PatternFileWarning>), StatusError>; | ||||
fn copy_map_len(&self) -> usize; | fn copy_map_len(&self) -> usize; | ||||
self.set_all_dirs() | self.set_all_dirs() | ||||
} | } | ||||
fn set_dirs(&mut self) -> Result<(), DirstateMapError> { | fn set_dirs(&mut self) -> Result<(), DirstateMapError> { | ||||
self.set_dirs() | self.set_dirs() | ||||
} | } | ||||
fn status<'a>( | fn status<'a>( | ||||
&'a self, | &'a mut self, | ||||
matcher: &'a (dyn Matcher + Sync), | matcher: &'a (dyn Matcher + Sync), | ||||
root_dir: PathBuf, | root_dir: PathBuf, | ||||
ignore_files: Vec<PathBuf>, | ignore_files: Vec<PathBuf>, | ||||
options: StatusOptions, | options: StatusOptions, | ||||
) -> Result<(DirstateStatus<'a>, Vec<PatternFileWarning>), StatusError> | ) -> Result<(DirstateStatus<'a>, Vec<PatternFileWarning>), StatusError> | ||||
{ | { | ||||
crate::status(self, matcher, root_dir, ignore_files, options) | crate::status(self, matcher, root_dir, ignore_files, options) | ||||
} | } |
use crate::dirstate_tree::dirstate_map::DirstateMap; | |||||
use crate::matchers::Matcher; | |||||
use crate::DirstateStatus; | |||||
use crate::PatternFileWarning; | |||||
use crate::StatusError; | |||||
use crate::StatusOptions; | |||||
use std::path::PathBuf; | |||||
pub fn status<'a>( | |||||
_dmap: &'a mut DirstateMap, | |||||
_matcher: &'a (dyn Matcher + Sync), | |||||
_root_dir: PathBuf, | |||||
_ignore_files: Vec<PathBuf>, | |||||
_options: StatusOptions, | |||||
) -> Result<(DirstateStatus<'a>, Vec<PatternFileWarning>), StatusError> { | |||||
todo!() | |||||
} |
list_ignored: bool, | list_ignored: bool, | ||||
list_unknown: bool, | list_unknown: bool, | ||||
collect_traversed_dirs: bool, | collect_traversed_dirs: bool, | ||||
) -> PyResult<PyTuple> { | ) -> PyResult<PyTuple> { | ||||
let bytes = root_dir.extract::<PyBytes>(py)?; | let bytes = root_dir.extract::<PyBytes>(py)?; | ||||
let root_dir = get_path_from_bytes(bytes.data(py)); | let root_dir = get_path_from_bytes(bytes.data(py)); | ||||
let dmap: DirstateMap = dmap.to_py_object(py); | let dmap: DirstateMap = dmap.to_py_object(py); | ||||
let dmap = dmap.get_inner(py); | let mut dmap = dmap.get_inner_mut(py); | ||||
let ignore_files: PyResult<Vec<_>> = ignore_files | let ignore_files: PyResult<Vec<_>> = ignore_files | ||||
.iter(py) | .iter(py) | ||||
.map(|b| { | .map(|b| { | ||||
let file = b.extract::<PyBytes>(py)?; | let file = b.extract::<PyBytes>(py)?; | ||||
Ok(get_path_from_bytes(file.data(py)).to_owned()) | Ok(get_path_from_bytes(file.data(py)).to_owned()) | ||||
}) | }) | ||||
.collect(); | .collect(); |
Should this be called get_inner_mut then?