Mercurial > hg
changeset 48149:6ac2b417d5d7
dirstate-item: directly use `p2_info` in `v1_size`
This is simpler.
Differential Revision: https://phab.mercurial-scm.org/D11593
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 01 Oct 2021 03:24:57 +0200 |
parents | e2753a7acfa7 |
children | d71feb05d5b6 |
files | mercurial/pure/parsers.py rust/hg-core/src/dirstate/entry.rs |
diffstat | 2 files changed, 2 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/pure/parsers.py Fri Oct 01 04:04:38 2021 +0200 +++ b/mercurial/pure/parsers.py Fri Oct 01 03:24:57 2021 +0200 @@ -363,16 +363,12 @@ raise RuntimeError('untracked item') elif self.removed and self._p1_tracked and self._p2_info: return NONNORMAL - elif self.removed and self._p2_info: + elif self._p2_info: return FROM_P2 elif self.removed: return 0 - elif self.merged: - return FROM_P2 elif self.added: return NONNORMAL - elif self.from_p2: - return FROM_P2 elif self._size is None: return NONNORMAL else:
--- a/rust/hg-core/src/dirstate/entry.rs Fri Oct 01 04:04:38 2021 +0200 +++ b/rust/hg-core/src/dirstate/entry.rs Fri Oct 01 03:24:57 2021 +0200 @@ -250,16 +250,12 @@ && self.flags.contains(Flags::P1_TRACKED | Flags::P2_INFO) { SIZE_NON_NORMAL - } else if self.removed() && self.flags.contains(Flags::P2_INFO) { + } else if self.flags.contains(Flags::P2_INFO) { SIZE_FROM_OTHER_PARENT } else if self.removed() { 0 - } else if self.merged() { - SIZE_FROM_OTHER_PARENT } else if self.added() { SIZE_NON_NORMAL - } else if self.from_p2() { - SIZE_FROM_OTHER_PARENT } else if let Some((_mode, size)) = self.mode_size { size } else {