From patchwork Sun Oct 3 10:54:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11607: dirstate-item: replace call to new_possibly_dirty From: phabricator X-Patchwork-Id: 49930 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sun, 3 Oct 2021 10:54:11 +0000 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/D11607 AFFECTED FILES mercurial/pure/parsers.py rust/hg-core/src/dirstate/entry.rs CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel 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 @@ -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 { diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py --- a/mercurial/pure/parsers.py +++ b/mercurial/pure/parsers.py @@ -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)