Merge problems after moving directories in a branch

Matt Mackall mpm at selenic.com
Tue Apr 6 16:26:30 CDT 2010


On Tue, 2010-04-06 at 11:18 +0100, Gustavo Narea wrote:
> Hi, Matt.
> 
> On 01/04/10 18:30, Matt Mackall wrote:
> > Send us a log with merge --debug.
> >   
> 
> It's attached to this email.

I think I see what's going on here. 

Alice:                   Bob:
rename foo -> old-foo    create foo/bar
rename new-foo -> foo
                         merge with Alice

It's ambiguous whether new file foo/bar should be moved to old-foo or stay put.

If we do the merge in two steps:

Alice:                   Bob:
rename foo -> old-foo    edit foo/bar
                         merge with Alice
rename new-foo -> foo
                         merge with Alice

..you'll get the result you're expecting.

The problem is that you're doing a "shell game" with old and new and
current with the assumption that Mercurial cares more about rename
history than about the filenames themselves. But Mercurial assumes that
if there are files on both sides called "template/mail.html", then it
should be merging "the mail template". It only goes looking for "the
thing that used to be the mail template" if it can't find "the mail
template" on one side.



-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial mailing list