Patchwork D12475: rust-dirstatemap: use `DirstateEntry::tracked` directly

login
register
mail settings
Submitter phabricator
Date April 6, 2022, 2:13 p.m.
Message ID <differential-rev-PHID-DREV-sixlihristhz5evs6qea-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50821/
State New
Headers show

Comments

phabricator - April 6, 2022, 2:13 p.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  `state()` is a legacy API that will be removed at some point, let's use the
  newer API.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/dirstate_tree/dirstate_map.rs

CHANGE DETAILS




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

Patch

diff --git a/rust/hg-core/src/dirstate_tree/dirstate_map.rs b/rust/hg-core/src/dirstate_tree/dirstate_map.rs
--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs
+++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs
@@ -982,9 +982,7 @@ 
         &mut self,
         filename: &HgPath,
     ) -> Result<(), DirstateError> {
-        let was_tracked = self
-            .get(filename)?
-            .map_or(false, |e| e.state().is_tracked());
+        let was_tracked = self.get(filename)?.map_or(false, |e| e.tracked());
         struct Dropped {
             was_tracked: bool,
             had_entry: bool,