From patchwork Mon Jul 19 10:40:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11127: dirstate-map: do not use `size` to gate copy dropping during remove_file From: phabricator X-Patchwork-Id: 49440 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Mon, 19 Jul 2021 10:40:03 +0000 marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This get us close to moving the block right above withing the DirstateItem object. Doing so will help us getting rid of magic constant at the dirstatemap level. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D11127 AFFECTED FILES mercurial/dirstatemap.py CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py --- a/mercurial/dirstatemap.py +++ b/mercurial/dirstatemap.py @@ -222,7 +222,7 @@ elif entry.from_p2: size = FROM_P2 self.otherparentset.add(f) - if size == 0: + if entry is not None and not (entry.merged or entry.from_p2): self.copymap.pop(f, None) if entry is not None and not entry.removed and "_dirs" in self.__dict__: