# HG changeset patch # User Pierre-Yves David # Date 1626298355 -7200 # Node ID 0efaa1bbad2bfb3568ba2d72c47d67c7b5cace07 # Parent 20f366db3e5fa2affa18f37fb0ee45316bc27528 dirstate-map: do not use `size` to gate copy dropping during remove_file 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. Differential Revision: https://phab.mercurial-scm.org/D11127 diff -r 20f366db3e5f -r 0efaa1bbad2b mercurial/dirstatemap.py --- a/mercurial/dirstatemap.py Thu Jul 15 00:27:29 2021 +0200 +++ b/mercurial/dirstatemap.py Wed Jul 14 23:32:35 2021 +0200 @@ -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__: