dirstate-item: replace another usage of `merged`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 01 Oct 2021 03:29:33 +0200
changeset 48152 8f88307f8e07
parent 48151 e0b4e4f80fff
child 48153 c29d312657d2
dirstate-item: replace another usage of `merged` We simply spell out the logic here. This was the last usage of `merged`. Differential Revision: https://phab.mercurial-scm.org/D11596
mercurial/pure/parsers.py
rust/hg-core/src/dirstate/entry.rs
--- a/mercurial/pure/parsers.py	Fri Oct 01 03:28:01 2021 +0200
+++ b/mercurial/pure/parsers.py	Fri Oct 01 03:29:33 2021 +0200
@@ -334,7 +334,7 @@
             raise RuntimeError('untracked item')
         elif self.removed:
             return b'r'
-        elif self.merged:
+        elif self._p1_tracked and self._p2_info:
             return b'm'
         elif self.added:
             return b'a'
--- a/rust/hg-core/src/dirstate/entry.rs	Fri Oct 01 03:28:01 2021 +0200
+++ b/rust/hg-core/src/dirstate/entry.rs	Fri Oct 01 03:29:33 2021 +0200
@@ -219,7 +219,10 @@
         }
         if self.removed() {
             EntryState::Removed
-        } else if self.merged() {
+        } else if self
+            .flags
+            .contains(Flags::WDIR_TRACKED | Flags::P1_TRACKED | Flags::P2_INFO)
+        {
             EntryState::Merged
         } else if self.added() {
             EntryState::Added