dirstate-item: replace call to new_merged
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 01 Oct 2021 09:12:52 +0200
changeset 48166 7a8c9869e4fe
parent 48165 c29d312657d2
child 48167 b2af515b4faf
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
mercurial/pure/parsers.py
rust/hg-core/src/dirstate/entry.rs
--- 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,
+            },
         }
     }