Patchwork D11127: dirstate-map: do not use `size` to gate copy dropping during remove_file

login
register
mail settings
Submitter phabricator
Date July 19, 2021, 10:40 a.m.
Message ID <differential-rev-PHID-DREV-akn3ocfe3cpps4qd6mrl-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49440/
State Superseded
Headers show

Comments

phabricator - July 19, 2021, 10:40 a.m.
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

Patch

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__: