Patchwork D12535: rust: remove use of `EntryState` in `DirsMultiset`

login
register
mail settings
Submitter phabricator
Date April 12, 2022, 4:05 p.m.
Message ID <differential-rev-PHID-DREV-w5in5s4fjawcqh2kxaks-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50882/
State New
Headers show

Comments

phabricator - April 12, 2022, 4:05 p.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Let's use the new API.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12535

AFFECTED FILES
  rust/hg-core/src/dirstate/dirs_multiset.rs

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/rust/hg-core/src/dirstate/dirs_multiset.rs b/rust/hg-core/src/dirstate/dirs_multiset.rs
--- a/rust/hg-core/src/dirstate/dirs_multiset.rs
+++ b/rust/hg-core/src/dirstate/dirs_multiset.rs
@@ -10,7 +10,6 @@ 
 //! Used to counts the references to directories in a manifest or dirstate.
 use crate::dirstate_tree::on_disk::DirstateV2ParseError;
 use crate::{
-    dirstate::EntryState,
     utils::{
         files,
         hg_path::{HgPath, HgPathBuf, HgPathError},
@@ -49,7 +48,7 @@ 
             let filename = filename.as_ref();
             // This `if` is optimized out of the loop
             if only_tracked {
-                if entry.state() != EntryState::Removed {
+                if !entry.removed() {
                     multiset.add_path(filename)?;
                 }
             } else {
@@ -215,6 +214,8 @@ 
 
 #[cfg(test)]
 mod tests {
+    use crate::EntryState;
+
     use super::*;
 
     #[test]