rust/hg-core/src/dirstate/status.rs
changeset 44525 f13d19549efd
parent 44524 483fce658e43
child 44526 61709b844420
equal deleted inserted replaced
44524:483fce658e43 44525:f13d19549efd
   253             Err(e) => Err(e),
   253             Err(e) => Err(e),
   254         }
   254         }
   255     })
   255     })
   256 }
   256 }
   257 
   257 
   258 pub struct StatusResult<'a> {
   258 pub struct DirstateStatus<'a> {
   259     pub modified: Vec<&'a HgPath>,
   259     pub modified: Vec<&'a HgPath>,
   260     pub added: Vec<&'a HgPath>,
   260     pub added: Vec<&'a HgPath>,
   261     pub removed: Vec<&'a HgPath>,
   261     pub removed: Vec<&'a HgPath>,
   262     pub deleted: Vec<&'a HgPath>,
   262     pub deleted: Vec<&'a HgPath>,
   263     pub clean: Vec<&'a HgPath>,
   263     pub clean: Vec<&'a HgPath>,
   265      * TODO unknown */
   265      * TODO unknown */
   266 }
   266 }
   267 
   267 
   268 fn build_response<'a>(
   268 fn build_response<'a>(
   269     results: impl IntoIterator<Item = IoResult<(&'a HgPath, Dispatch)>>,
   269     results: impl IntoIterator<Item = IoResult<(&'a HgPath, Dispatch)>>,
   270 ) -> IoResult<(Vec<&'a HgPath>, StatusResult<'a>)> {
   270 ) -> IoResult<(Vec<&'a HgPath>, DirstateStatus<'a>)> {
   271     let mut lookup = vec![];
   271     let mut lookup = vec![];
   272     let mut modified = vec![];
   272     let mut modified = vec![];
   273     let mut added = vec![];
   273     let mut added = vec![];
   274     let mut removed = vec![];
   274     let mut removed = vec![];
   275     let mut deleted = vec![];
   275     let mut deleted = vec![];
   288         }
   288         }
   289     }
   289     }
   290 
   290 
   291     Ok((
   291     Ok((
   292         lookup,
   292         lookup,
   293         StatusResult {
   293         DirstateStatus {
   294             modified,
   294             modified,
   295             added,
   295             added,
   296             removed,
   296             removed,
   297             deleted,
   297             deleted,
   298             clean,
   298             clean,
   303 pub fn status<'a: 'c, 'b: 'c, 'c>(
   303 pub fn status<'a: 'c, 'b: 'c, 'c>(
   304     dmap: &'a DirstateMap,
   304     dmap: &'a DirstateMap,
   305     matcher: &'b impl Matcher,
   305     matcher: &'b impl Matcher,
   306     root_dir: impl AsRef<Path> + Sync + Send + Copy,
   306     root_dir: impl AsRef<Path> + Sync + Send + Copy,
   307     options: StatusOptions,
   307     options: StatusOptions,
   308 ) -> IoResult<(Vec<&'c HgPath>, StatusResult<'c>)> {
   308 ) -> IoResult<(Vec<&'c HgPath>, DirstateStatus<'c>)> {
   309     let files = matcher.file_set();
   309     let files = matcher.file_set();
   310     let mut results = vec![];
   310     let mut results = vec![];
   311     if let Some(files) = files {
   311     if let Some(files) = files {
   312         results.par_extend(walk_explicit(&files, &dmap, root_dir, options));
   312         results.par_extend(walk_explicit(&files, &dmap, root_dir, options));
   313     }
   313     }