Bug 3074 - Merge of files renamed in one branch and deleted in the other
Summary: Merge of files renamed in one branch and deleted in the other
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: earlier
Hardware: All All
: normal feature
Assignee: Thomas Arendsen Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-27 02:31 UTC by Thomas Arendsen Hein
Modified: 2017-11-01 18:05 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Arendsen Hein 2011-10-27 02:31 UTC
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:
 newfile
 file2

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:
 newfile


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
justified.
Comment 1 Bugzilla 2012-05-12 09:24 UTC
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:24 EDT  ---

This bug was previously known as _bug_ 3074 at http://mercurial.selenic.com/bts/issue3074

Bug Status was UNCONFIRMED but everconfirmed was true
   Setting status to CONFIRMED

Comment 2 Thomas Arendsen Hein 2012-05-24 04:10 UTC
I pushed a fix to this to crew:
http://hg.intevation.org/mercurial/crew/rev/98687cdddcb1

Output for "hg merge --debug" was added in the next changeset:
http://hg.intevation.org/mercurial/crew/rev/e9ae770eff1c
Comment 3 Thomas Arendsen Hein 2012-06-05 03:34 UTC
In main.