rust/rhg/src/commands/status.rs
changeset 51271 eab5b061cd48
parent 51191 13f58ce70299
equal deleted inserted replaced
51270:ceeb8fa23cc8 51271:eab5b061cd48
   444             filesystem_time_at_status_start,
   444             filesystem_time_at_status_start,
   445         ))
   445         ))
   446     };
   446     };
   447     let (narrow_matcher, narrow_warnings) = narrow::matcher(repo)?;
   447     let (narrow_matcher, narrow_warnings) = narrow::matcher(repo)?;
   448 
   448 
   449     match revpair {
   449     if let Some((rev1, rev2)) = revpair {
   450         Some((rev1, rev2)) => {
   450         let mut ds_status = DirstateStatus::default();
   451             let mut ds_status = DirstateStatus::default();
   451         if list_copies {
   452             if list_copies {
   452             return Err(CommandError::unsupported(
   453                 return Err(CommandError::unsupported(
   453                 "status --rev --rev with copy information is not implemented yet",
   454                     "status --rev --rev with copy information is not implemented yet",
   454             ));
   455                 ));
   455         }
   456             }
   456 
   457 
   457         let stat = hg::operations::status_rev_rev_no_copies(
   458             let stat = hg::operations::status_rev_rev_no_copies(
   458             repo,
   459                 repo,
   459             rev1,
   460                 rev1,
   460             rev2,
   461                 rev2,
   461             narrow_matcher,
   462                 narrow_matcher,
   462         )?;
   463             )?;
   463         for entry in stat.iter() {
   464             for entry in stat.iter() {
   464             let (path, status) = entry?;
   465                 let (path, status) = entry?;
   465             let path = StatusPath {
   466                 let path = StatusPath {
   466                 path: Cow::Borrowed(path),
   467                     path: Cow::Borrowed(path),
   467                 copy_source: None,
   468                     copy_source: None,
   468             };
   469                 };
   469             match status {
   470                 match status {
   470                 hg::operations::DiffStatus::Removed => {
   471                     hg::operations::DiffStatus::Removed => {
   471                     if display_states.removed {
   472                         if display_states.removed {
   472                         ds_status.removed.push(path)
   473                             ds_status.removed.push(path)
       
   474                         }
       
   475                     }
   473                     }
   476                     hg::operations::DiffStatus::Added => {
   474                 }
   477                         if display_states.added {
   475                 hg::operations::DiffStatus::Added => {
   478                             ds_status.added.push(path)
   476                     if display_states.added {
   479                         }
   477                         ds_status.added.push(path)
   480                     }
   478                     }
   481                     hg::operations::DiffStatus::Modified => {
   479                 }
   482                         if display_states.modified {
   480                 hg::operations::DiffStatus::Modified => {
   483                             ds_status.modified.push(path)
   481                     if display_states.modified {
   484                         }
   482                         ds_status.modified.push(path)
   485                     }
   483                     }
   486                     hg::operations::DiffStatus::Matching => {
   484                 }
   487                         if display_states.clean {
   485                 hg::operations::DiffStatus::Matching => {
   488                             ds_status.clean.push(path)
   486                     if display_states.clean {
   489                         }
   487                         ds_status.clean.push(path)
   490                     }
   488                     }
   491                 }
   489                 }
   492             }
   490             }
   493             output.output(display_states, ds_status)?;
   491         }
   494             return Ok(());
   492         output.output(display_states, ds_status)?;
   495         }
   493         return Ok(());
   496         None => (),
       
   497     }
   494     }
   498 
   495 
   499     let (sparse_matcher, sparse_warnings) = sparse::matcher(repo)?;
   496     let (sparse_matcher, sparse_warnings) = sparse::matcher(repo)?;
   500     let matcher = match (repo.has_narrow(), repo.has_sparse()) {
   497     let matcher = match (repo.has_narrow(), repo.has_sparse()) {
   501         (true, true) => {
   498         (true, true) => {