--- a/mercurial/merge.py Mon Sep 14 13:51:39 2020 +0530
+++ b/mercurial/merge.py Tue Sep 01 17:08:26 2020 +0530
@@ -563,7 +563,10 @@
It has information about what actions need to be performed on dirstate
mapping of divergent renames and other such cases. '''
- NO_OP_ACTIONS = (mergestatemod.ACTION_KEEP,)
+ NO_OP_ACTIONS = (
+ mergestatemod.ACTION_KEEP,
+ mergestatemod.ACTION_KEEP_ABSENT,
+ )
def __init__(self):
"""
@@ -1176,6 +1179,11 @@
repo.ui.note(_(b" %s: picking 'keep' action\n") % f)
mresult.addfile(f, *bids[mergestatemod.ACTION_KEEP][0])
continue
+ # If keep absent is an option, just do that
+ if mergestatemod.ACTION_KEEP_ABSENT in bids:
+ repo.ui.note(_(b" %s: picking 'keep absent' action\n") % f)
+ mresult.addfile(f, *bids[mergestatemod.ACTION_KEEP_ABSENT][0])
+ continue
# If there are gets and they all agree [how could they not?], do it.
if mergestatemod.ACTION_GET in bids:
ga0 = bids[mergestatemod.ACTION_GET][0]
@@ -1530,6 +1538,11 @@
):
repo.ui.debug(b" %s: %s -> k\n" % (f, msg))
# no progress
+ for f, args, msg in mresult.getactions(
+ (mergestatemod.ACTION_KEEP_ABSENT,), sort=True
+ ):
+ repo.ui.debug(b" %s: %s -> ka\n" % (f, msg))
+ # no progress
# directory rename, move local
for f, args, msg in mresult.getactions(