diff mercurial/copies.py @ 45798:ff7e0ca666e8

copies: make sure deleted copy info do not overwriting unrelated ones See test documentation for details. This is yet another corner case for copy tracing. Differential Revision: https://phab.mercurial-scm.org/D9200
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 13 Oct 2020 05:15:44 +0200
parents 7990e7d957b0
children 06b64fabf91c
line wrap: on
line diff
--- a/mercurial/copies.py	Wed Oct 21 22:30:42 2020 +0200
+++ b/mercurial/copies.py	Tue Oct 13 05:15:44 2020 +0200
@@ -400,7 +400,10 @@
             elif changes is not None and dest in changes.merged:
                 minor[dest] = value
             elif not isancestor(new_tt, other_tt):
-                minor[dest] = value
+                if value[1] is not None:
+                    minor[dest] = value
+                elif isancestor(other_tt, new_tt):
+                    minor[dest] = value
 
 
 def _revinfo_getter_extra(repo):