changeset 48152:8f88307f8e07

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 01 Oct 2021 03:29:33 +0200
parents e0b4e4f80fff
children c29d312657d2
files mercurial/pure/parsers.py rust/hg-core/src/dirstate/entry.rs
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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