diff mercurial/merge.py @ 45469:49ffaa4f65f6

merge: add missing ACTION_KEEP when both remote and ancestor are not present Previous patch may lead to confusion that the related criss-cross merge is consistent when done from any of the parents. However this is not true and we were missing setting an ACTION_KEEP. This patch now exposes that bid-merge favors ACTION_KEEP always and the result of merge is different when started from different parents. This change also effects a test case above where bid merge was wrongly picking `r` because it was missing keep related information from one of the ancestor. After this test, we are back in a state in the criss-cross merge tests where the result depends on which parent we are merging from. Differential Revision: https://phab.mercurial-scm.org/D8941
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 24 Aug 2020 17:22:28 +0530
parents 09edbff6ae8d
children 6e474eec4be6
line wrap: on
line diff
--- a/mercurial/merge.py	Mon Aug 24 15:20:09 2020 +0530
+++ b/mercurial/merge.py	Mon Aug 24 17:22:28 2020 +0530
@@ -932,6 +932,14 @@
                     mresult.addfile(
                         f, mergestatemod.ACTION_REMOVE, None, b'other deleted',
                     )
+            else:  # file not in ancestor, not in remote
+                mresult.addfile(
+                    f,
+                    mergestatemod.ACTION_KEEP,
+                    None,
+                    b'ancestor missing, remote missing',
+                )
+
         elif n2:  # file exists only on remote side
             if f in copied1:
                 pass  # we'll deal with it on m1 side