3 // Copyright 2019, Raphaël Gomès <rgomes@octobus.net> |
3 // Copyright 2019, Raphaël Gomès <rgomes@octobus.net> |
4 // |
4 // |
5 // This software may be used and distributed according to the terms of the |
5 // This software may be used and distributed according to the terms of the |
6 // GNU General Public License version 2 or any later version. |
6 // GNU General Public License version 2 or any later version. |
7 |
7 |
8 use crate::dirstate::status::{build_response, Dispatch, HgPathCow, Status}; |
8 use crate::dirstate::status::{build_response, Dispatch, Status}; |
9 use crate::matchers::Matcher; |
9 use crate::matchers::Matcher; |
10 use crate::{DirstateStatus, StatusError}; |
10 use crate::{DirstateStatus, StatusError}; |
11 |
11 |
12 /// A tuple of the paths that need to be checked in the filelog because it's |
|
13 /// ambiguous whether they've changed, and the rest of the already dispatched |
|
14 /// files. |
|
15 pub type LookupAndStatus<'a> = (Vec<HgPathCow<'a>>, DirstateStatus<'a>); |
|
16 |
|
17 impl<'a, M: ?Sized + Matcher + Sync> Status<'a, M> { |
12 impl<'a, M: ?Sized + Matcher + Sync> Status<'a, M> { |
18 pub(crate) fn run(&self) -> Result<LookupAndStatus<'a>, StatusError> { |
13 pub(crate) fn run(&self) -> Result<DirstateStatus<'a>, StatusError> { |
19 let (traversed_sender, traversed_receiver) = |
14 let (traversed_sender, traversed_receiver) = |
20 crossbeam_channel::unbounded(); |
15 crossbeam_channel::unbounded(); |
21 |
16 |
22 // Step 1: check the files explicitly mentioned by the user |
17 // Step 1: check the files explicitly mentioned by the user |
23 let (work, mut results) = self.walk_explicit(traversed_sender.clone()); |
18 let (work, mut results) = self.walk_explicit(traversed_sender.clone()); |