Patchwork D11604: dirstate-item: replace call to new_possibly_dirty

login
register
mail settings
Submitter phabricator
Date Oct. 3, 2021, 10:54 a.m.
Message ID <differential-rev-PHID-DREV-4n6prvfsxdp5tdccvm5p-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49927/
State Superseded
Headers show

Comments

phabricator - Oct. 3, 2021, 10:54 a.m.
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/D11604

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

CHANGE DETAILS




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

Patch

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
@@ -75,7 +75,11 @@ 
                         mtime: None,
                     }
                 } else if size == SIZE_NON_NORMAL {
-                    Self::new_possibly_dirty()
+                    Self {
+                        flags: Flags::WDIR_TRACKED | Flags::P1_TRACKED,
+                        mode_size: None,
+                        mtime: None,
+                    }
                 } else if mtime == MTIME_UNSET {
                     Self {
                         flags: Flags::WDIR_TRACKED | Flags::P1_TRACKED,
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 size == FROM_P2:
                 return cls(wc_tracked=True, p2_info=True)
             elif size == NONNORMAL:
-                return cls.new_possibly_dirty()
+                return cls(wc_tracked=True, p1_tracked=True)
             elif mtime == AMBIGUOUS_TIME:
                 instance = cls.new_normal(mode, size, 42)
                 instance._mtime = None