@@ -1608,6 +1608,27 @@ def applyupdates(
if not complete:
numupdates += 1
tocomplete.append((f, args, msg))
+ else:
+ action = mresult.getfile(f)[0]
+ if action in (
+ mergestatemod.ACTION_DELETED_CHANGED,
+ mergestatemod.ACTION_CHANGED_DELETED,
+ ):
+ # the merge was conflicting and either the mergetool
+ # choosed by the user or the user themselves on the prompt
+ # made a choice.
+ # If the changed file was kept, at commit we end up using
+ # the same filelog. This is not completely correct behavior
+ # as the new file post merge also represents that a
+ # conflicting change-delete merge was resolved in it's
+ # favor. Hence we will like to create a new filenode for
+ # that. Let's store this in mergestate extras
+ repo.ui.debug(
+ b"file %s had %s conflicts and mergetool resolved it, storing info in commitinfo\n"
+ % (f, action)
+ )
+
+ ms.addcommitinfo(f, {b'MERGE_REMOVAL_CANDIDATE': b'yes'})
# merge
for f, args, msg in tocomplete:
@@ -82,11 +82,13 @@ Non-interactive merge:
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "u")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file3 (state "u")
local path: file3 (hash d5b0a58bc47161b1b8a831084b366f757c4f0b11, flags "")
@@ -147,11 +149,13 @@ Interactive merge:
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "r")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file3 (state "u")
local path: file3 (hash d5b0a58bc47161b1b8a831084b366f757c4f0b11, flags "")
@@ -225,11 +229,13 @@ Interactive merge with bad input:
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "r")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file3 (state "u")
local path: file3 (hash d5b0a58bc47161b1b8a831084b366f757c4f0b11, flags "")
@@ -287,11 +293,13 @@ Interactive merge with not enough input:
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "u")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file3 (state "u")
local path: file3 (hash d5b0a58bc47161b1b8a831084b366f757c4f0b11, flags "")
@@ -336,11 +344,13 @@ Choose local versions of files
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "r")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file3 (state "r")
local path: file3 (hash d5b0a58bc47161b1b8a831084b366f757c4f0b11, flags "")
@@ -381,11 +391,13 @@ Choose other versions of files
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "r")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file3 (state "r")
local path: file3 (hash d5b0a58bc47161b1b8a831084b366f757c4f0b11, flags "")
@@ -427,11 +439,13 @@ Fail
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "u")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file3 (state "u")
local path: file3 (hash d5b0a58bc47161b1b8a831084b366f757c4f0b11, flags "")
@@ -484,11 +498,13 @@ Force prompts with no input (should be s
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "u")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file3 (state "u")
local path: file3 (hash d5b0a58bc47161b1b8a831084b366f757c4f0b11, flags "")
@@ -543,11 +559,13 @@ Force prompts
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "u")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file3 (state "u")
local path: file3 (hash d5b0a58bc47161b1b8a831084b366f757c4f0b11, flags "")
@@ -599,11 +617,13 @@ Choose to merge all files
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "u")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file3 (state "u")
local path: file3 (hash d5b0a58bc47161b1b8a831084b366f757c4f0b11, flags "")
@@ -768,11 +788,13 @@ Non-interactive linear update
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "u")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
--- file1 ---
1
@@ -807,11 +829,13 @@ Choose local versions of files
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "r")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
--- file1 ---
1
@@ -844,11 +868,13 @@ Choose other versions of files
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "r")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
*** file1 does not exist
--- file2 ---
@@ -883,11 +909,13 @@ Fail
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "u")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
--- file1 ---
1
@@ -930,11 +958,13 @@ Force prompts with no input
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "u")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
--- file1 ---
1
@@ -978,11 +1008,13 @@ Choose to merge all files
local path: file1 (hash 60b27f004e454aca81b0480209cce5081ec52390, flags "")
ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
other path: file1 (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
file: file2 (state "u")
local path: file2 (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff
--- file1 ---
1
@@ -534,6 +534,7 @@ Do all the merge combination (from the deleted or the update side × keeping and deleting the file
local path: the-file (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: the-file (node 4b69178b9bdae28b651393b46e631427a72f217a)
other path: the-file (node 59e363a07dc876278f0e41756236f30213b6b460)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = 955800955977bd6c103836ee3e437276e940a589
extra: other-file (filenode-source = other)
$ hg ci -m "merge-deleting-the-file-from-deleted"
@@ -556,6 +557,7 @@ Do all the merge combination (from the deleted or the update side × keeping and deleting the file
local path: the-file (hash 6d2e02da5a9fe0691363dc6b573845fa271eaa35, flags "")
ancestor path: the-file (node 4b69178b9bdae28b651393b46e631427a72f217a)
other path: the-file (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = 955800955977bd6c103836ee3e437276e940a589
$ hg ci -m "merge-deleting-the-file-from-updated"
created new head
@@ -578,6 +580,7 @@ Do all the merge combination (from the deleted or the update side × keeping and deleting the file
local path: the-file (hash 0000000000000000000000000000000000000000, flags "")
ancestor path: the-file (node 4b69178b9bdae28b651393b46e631427a72f217a)
other path: the-file (node 59e363a07dc876278f0e41756236f30213b6b460)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = 955800955977bd6c103836ee3e437276e940a589
extra: other-file (filenode-source = other)
$ hg ci -m "merge-keeping-the-file-from-deleted"
@@ -607,6 +610,7 @@ in consideration.
local path: the-file (hash 6d2e02da5a9fe0691363dc6b573845fa271eaa35, flags "")
ancestor path: the-file (node 4b69178b9bdae28b651393b46e631427a72f217a)
other path: the-file (node 0000000000000000000000000000000000000000)
+ extra: MERGE_REMOVAL_CANDIDATE = yes
extra: ancestorlinknode = 955800955977bd6c103836ee3e437276e940a589
$ hg ci -m "merge-keeping-the-file-from-updated"
created new head