D11602: dirstate-item: replace call to new_from_p2
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Sun Oct 3 10:53:41 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/D11602
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
@@ -68,7 +68,12 @@
match state {
EntryState::Normal => {
if size == SIZE_FROM_OTHER_PARENT {
- Self::new_from_p2()
+ Self {
+ // might be missing P1_TRACKED
+ flags: Flags::WDIR_TRACKED | Flags::P2_INFO,
+ mode_size: None,
+ mtime: None,
+ }
} else if size == SIZE_NON_NORMAL {
Self::new_possibly_dirty()
} else if mtime == MTIME_UNSET {
diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py
+++ b/mercurial/pure/parsers.py
@@ -162,7 +162,7 @@
return cls(p1_tracked=p1_tracked, p2_info=p2_info)
elif state == b'n':
if size == FROM_P2:
- return cls.new_from_p2()
+ return cls(wc_tracked=True, p2_info=True)
elif size == NONNORMAL:
return cls.new_possibly_dirty()
elif mtime == AMBIGUOUS_TIME:
To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list