rust/hg-core/src/operations/dirstate_status.rs
changeset 47110 9c6b458a08e1
parent 47093 787ff5d21bcd
child 47347 73ddcedeaadf
equal deleted inserted replaced
47109:33e5511b571a 47110:9c6b458a08e1
     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());