dirstate-item: replace call to new_normal
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 01 Oct 2021 09:29:32 +0200
changeset 48163 d0081dbca442
parent 48162 79ebbe19d9e3
child 48164 1ab4523afe12
dirstate-item: replace call to new_normal The constructor is on its way out, so we inline the last relevant call before dropping it. Differential Revision: https://phab.mercurial-scm.org/D11607
mercurial/pure/parsers.py
rust/hg-core/src/dirstate/entry.rs
--- a/mercurial/pure/parsers.py	Fri Oct 01 09:28:19 2021 +0200
+++ b/mercurial/pure/parsers.py	Fri Oct 01 09:29:32 2021 +0200
@@ -157,7 +157,11 @@
                     parentfiledata=(mode, size, 42),
                 )
             else:
-                return cls.new_normal(mode, size, mtime)
+                return cls(
+                    wc_tracked=True,
+                    p1_tracked=True,
+                    parentfiledata=(mode, size, mtime),
+                )
         else:
             raise RuntimeError(b'unknown state: %s' % state)
 
--- a/rust/hg-core/src/dirstate/entry.rs	Fri Oct 01 09:28:19 2021 +0200
+++ b/rust/hg-core/src/dirstate/entry.rs	Fri Oct 01 09:29:32 2021 +0200
@@ -87,7 +87,11 @@
                         mtime: None,
                     }
                 } else {
-                    Self::new_normal(mode, size, mtime)
+                    Self {
+                        flags: Flags::WDIR_TRACKED | Flags::P1_TRACKED,
+                        mode_size: Some((mode, size)),
+                        mtime: Some(mtime),
+                    }
                 }
             }
             EntryState::Added => Self {