dirstate-map: do not use `size` to gate copy dropping during remove_file
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 14 Jul 2021 23:32:35 +0200
changeset 47672 0efaa1bbad2b
parent 47671 20f366db3e5f
child 47673 37825a85d3b0
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
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__: