changeset 48166:7a8c9869e4fe

dirstate-item: replace call to new_merged The constructor is on its way out, so we inline the last relevant call before dropping it. Differential Revision: https://phab.mercurial-scm.org/D11598
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 01 Oct 2021 09:12:52 +0200
parents c29d312657d2
children b2af515b4faf
files mercurial/pure/parsers.py rust/hg-core/src/dirstate/entry.rs
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/pure/parsers.py	Fri Oct 01 03:30:00 2021 +0200
+++ b/mercurial/pure/parsers.py	Fri Oct 01 09:12:52 2021 +0200
@@ -162,7 +162,7 @@
         is not expected to change, unlike the __init__ one.
         """
         if state == b'm':
-            return cls.new_merged()
+            return cls(wc_tracked=True, p1_tracked=True, p2_info=True)
         elif state == b'a':
             return cls.new_added()
         elif state == b'r':
--- a/rust/hg-core/src/dirstate/entry.rs	Fri Oct 01 03:30:00 2021 +0200
+++ b/rust/hg-core/src/dirstate/entry.rs	Fri Oct 01 09:12:52 2021 +0200
@@ -94,7 +94,13 @@
                 mode_size: None,
                 mtime: None,
             },
-            EntryState::Merged => Self::new_merged(),
+            EntryState::Merged => Self {
+                flags: Flags::WDIR_TRACKED
+                    | Flags::P1_TRACKED // might not be true because of rename ?
+                    | Flags::P2_INFO, // might not be true because of rename ?
+                mode_size: None,
+                mtime: None,
+            },
         }
     }