[issue3074] Merge of files renamed in one branch and deleted in the other

Thomas Arendsen Hein bugs at mercurial.selenic.com
Thu Oct 27 03:31:13 CDT 2011

New submission from Thomas Arendsen Hein <thomas at intevation.de>:

similar to issue455 (Divergent renames should be conflicts):

When a file is renamed in one branch and deleted in the other, currently
(2.0-rc) the file still exists after a merge.

For divergent renames the following message is printed during merge:
note: possible conflict - file was renamed multiple times to:

I suggest that a similar message is printed for mv+rm, e.g.:

note: possible conflict - file deleted in one branch was renamed in the other:

A script to reproduce quickly:

hg init
echo foo > file
hg add file
hg commit -m "added file"
hg mv file newfile
hg commit -m "renamed file"
hg update 0
hg rm file
hg commit -m "deleted file"
hg merge
hg status

The output of "hg merge" currently is:
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)

"hg status" shows:
M newfile

If the file had not been renamed, but just changed, there would be the
following prompt:

remote changed file which local deleted
use (c)hanged version or leave (d)eleted?

With the same argumentation as in issue455 I would not think a prompt is

assignedto: ThomasAH
messages: 17856
nosy: ThomasAH
priority: feature
status: unread
title: Merge of files renamed in one branch and deleted in the other
topic: merge, surprise

Mercurial issue tracker <bugs at mercurial.selenic.com>

More information about the Mercurial-devel mailing list