diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -951,6 +951,15 @@ mresult.addfile( f, mergestatemod.ACTION_REMOVE, None, b'other deleted', ) + if branchmerge: + # the file must be absent after merging, + # howeber the user might make + # the file reappear using revert and if they does, + # we force create a new node + mresult.addcommitinfo( + f, b'MERGE_DELETE_CANDIDATE', b'yes' + ) + else: # file not in ancestor, not in remote rename_found = False for source, dest in branch_copies1.dirmove.items(): @@ -1097,6 +1106,14 @@ None, b'local not present, remote unchanged', ) + if branchmerge: + # the file must be absent after merging + # however the user might make + # the file reappear using revert and if they does, + # we force create a new node + mresult.addcommitinfo( + f, b'MERGE_DELETE_CANDIDATE', b'yes' + ) # make sure actions for rename destination are there and if not # add them diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t --- a/tests/test-merge-criss-cross.t +++ b/tests/test-merge-criss-cross.t @@ -681,7 +681,9 @@ $ ls -1 other-file $ hg debugmergestate - no merge state found + local (working copy): adfd88e5d7d3d3e22bdd26512991ee64d59c1d8f + other (merge rev): 5e3eccec60d88f94a7ba57c351f32cb24c15fe0c + extra: the-file (MERGE_DELETE_CANDIDATE = yes) (merging two deletion together → no conflict) @@ -720,7 +722,9 @@ $ ls -1 other-file $ hg debugmergestate - no merge state found + local (working copy): a4e0e44229dc130be2915b92c957c093f8c7ee3e + other (merge rev): 5e3eccec60d88f94a7ba57c351f32cb24c15fe0c + extra: the-file (MERGE_DELETE_CANDIDATE = yes) (merging two "keeping" together → no conflict) @@ -763,7 +767,9 @@ other-file the-file $ hg debugmergestate - no merge state found + local (working copy): 5e3eccec60d88f94a7ba57c351f32cb24c15fe0c + other (merge rev): a4e0e44229dc130be2915b92c957c093f8c7ee3e + extra: the-file (MERGE_DELETE_CANDIDATE = yes) (merging two "keeping" together → no conflict)