changeset 47904:822c67420c77

dirstatemap: use the default code to handle "merged" case This simplify the conditionnal a bit since most of it is handled by the common code. Differential Revision: https://phab.mercurial-scm.org/D11329
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 16 Jul 2021 17:32:40 +0200
parents 6816ae362ddd
children c0d6a59a7704
files mercurial/dirstatemap.py
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstatemap.py	Fri Jul 16 17:29:16 2021 +0200
+++ b/mercurial/dirstatemap.py	Fri Jul 16 17:32:40 2021 +0200
@@ -260,16 +260,13 @@
         elif merged:
             # XXX might be merged and removed ?
             entry = self.get(filename)
-            if entry is not None and entry.tracked:
+            if entry is None or not entry.tracked:
                 # XXX mostly replicate dirstate.other parent.  We should get
                 # the higher layer to pass us more reliable data where `merged`
-                # actually mean merged. Dropping the else clause will show
-                # failure in `test-graft.t`
-                self.addfile(filename, merged=True)
-                return
-            else:
-                self.addfile(filename, from_p2=True)
-                return
+                # actually mean merged. Dropping this clause will show failure
+                # in `test-graft.t`
+                merged = False
+                clean_p2 = True
         elif not (p1_tracked or p2_tracked) and wc_tracked:
             pass  # file is added, nothing special to adjust
         elif (p1_tracked or p2_tracked) and not wc_tracked: