diff mercurial/dirstate.py @ 47517:28632eb3ca3e

dirstate-entry: restrict `from_p2` property to tracked file The other case is now handled in `from_p2_removed`, and should ideally be moved to a lower level. So we can drop the `state == 'n'` narrowing and move it in the property itself. Differential Revision: https://phab.mercurial-scm.org/D10959
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 04 Jul 2021 01:14:15 +0200
parents b8ffe85e399b
children abed645b8e96
line wrap: on
line diff
--- a/mercurial/dirstate.py	Sat Jul 03 20:34:09 2021 +0200
+++ b/mercurial/dirstate.py	Sun Jul 04 01:14:15 2021 +0200
@@ -393,7 +393,7 @@
                         copies[f] = source
                     self.normallookup(f)
                 # Also fix up otherparent markers
-                elif s.state == b'n' and s.from_p2:
+                elif s.from_p2:
                     source = self._map.copymap.get(f)
                     if source:
                         copies[f] = source
@@ -542,7 +542,7 @@
                     if source is not None:
                         self.copy(source, f)
                     return
-                elif entry.merged or entry.state == b'n' and entry.from_p2:
+                elif entry.merged or entry.from_p2:
                     return
         self._addpath(f, b'n', 0, possibly_dirty=True)
         self._map.copymap.pop(f, None)