Patchwork D12537: rust-dirstatemap: stop using `.state` in `is_from_other_parent`

login
register
mail settings
Submitter phabricator
Date April 12, 2022, 4:05 p.m.
Message ID <differential-rev-PHID-DREV-yk2da5yg2hixfocqkqpu-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50885/
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
  This is a deprecated API and will be removed one day.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

CHANGE DETAILS




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

Patch

diff --git a/rust/hg-core/src/dirstate/entry.rs b/rust/hg-core/src/dirstate/entry.rs
--- a/rust/hg-core/src/dirstate/entry.rs
+++ b/rust/hg-core/src/dirstate/entry.rs
@@ -655,8 +655,7 @@ 
     }
 
     pub(crate) fn is_from_other_parent(&self) -> bool {
-        self.state() == EntryState::Normal
-            && self.size() == SIZE_FROM_OTHER_PARENT
+        self.flags.contains(Flags::WDIR_TRACKED | Flags::P2_INFO)
     }
 
     // TODO: other platforms