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![]; |
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 } |