mercurial/localrepo.py
changeset 44687 1b8fd4af3318
parent 44548 fdc802f29b2c
child 44733 c6d31e659a28
child 44826 35b255e474d9
--- a/mercurial/localrepo.py	Thu Apr 09 15:44:21 2020 -0400
+++ b/mercurial/localrepo.py	Thu Apr 09 16:06:03 2020 +0530
@@ -2855,6 +2855,14 @@
                 fparent1, fparent2 = fparent2, nullid
             elif fparent2 in fparentancestors:
                 fparent2 = nullid
+            elif not fparentancestors:
+                # TODO: this whole if-else might be simplified much more
+                ms = mergemod.mergestate.read(self)
+                if (
+                    fname in ms
+                    and ms[fname] == mergemod.MERGE_RECORD_MERGED_OTHER
+                ):
+                    fparent1, fparent2 = fparent2, nullid
 
         # is the file changed?
         text = fctx.data()