D11600: dirstate-item: replace call to new_added

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Sun Oct 3 10:52:56 UTC 2021


marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The constructor is on its way out, so we inline the last relevant call before
  dropping it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11600

AFFECTED FILES
  mercurial/pure/parsers.py
  rust/hg-core/src/dirstate/entry.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/dirstate/entry.rs b/rust/hg-core/src/dirstate/entry.rs
--- a/rust/hg-core/src/dirstate/entry.rs
+++ b/rust/hg-core/src/dirstate/entry.rs
@@ -81,7 +81,11 @@
                     Self::new_normal(mode, size, mtime)
                 }
             }
-            EntryState::Added => Self::new_added(),
+            EntryState::Added => Self {
+                flags: Flags::WDIR_TRACKED,
+                mode_size: None,
+                mtime: None,
+            },
             EntryState::Removed => Self {
                 flags: if size == SIZE_NON_NORMAL {
                     Flags::P1_TRACKED | Flags::P2_INFO
diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py
+++ b/mercurial/pure/parsers.py
@@ -156,7 +156,7 @@
         if state == b'm':
             return cls(wc_tracked=True, p1_tracked=True, p2_info=True)
         elif state == b'a':
-            return cls.new_added()
+            return cls(wc_tracked=True)
         elif state == b'r':
             if size == NONNORMAL:
                 p1_tracked = True



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list