Another weird merge error...

John Szakmeister john at szakmeister.net
Sun Aug 15 09:27:30 BST 2010


On Sat, Aug 14, 2010 at 10:29 AM, John Szakmeister <john at szakmeister.net> wrote:
[snip]
> branch2:
> file.txt
> foo/
>  bar.txt.BASE
>  bar.txt.OTHER
> foo.moved/
>  bar.txt
>
> What's confusing here is that it appears Bazaar tried to merge
> bar.txt, but the conflicted files are in foo.  However, the original
> file is in foo.moved.  And, bzr st says:
>
> added:
>  foo/
>  foo/bar.txt.OTHER
> renamed:
>  foo/ => foo.moved/
> unknown:
>  branch1-nofoo/
>  branch2-nofoo/
>  foo/bar.txt.BASE
> conflicts:
>  Conflict adding files to foo.  Created directory.
>  Conflict because foo is not versioned, but has versioned children.
> Versioned directory.
>  Conflict adding file foo.  Moved existing file to foo.moved.
>  Contents conflict in foo/bar.txt
> pending merge tips: (use -v to see all merge revisions)
>  John Szakmeister 2010-08-14 Add more baz to my bar.

So I think I finally understand what's happening here.  First, bar.txt
is missing because the result of the previous merge was to remove it.
So Bazaar ends up creating a conflict because it doesn't know what to
do with the file because it was updated in the other branch.  At that
point, we have the bar.txt.BASE and bar.txt.OTHER files.  It was also
confusing me that one of them was versioned, while the other wasn't...
but that's because Bazaar wanted to re-instate the file, but the
previous merge deleted it... so, Bazaar added it with a new name.
Finally, the line about foo not being version, but has versioned
children, is because foo was also deleted as part of the previous
merge, but since it also wanted to inform us about issues with
bar.txt, it was re-instated.

I think it would have been useful to have words in the conflict saying
that foo was unversioned because of a previous merge, or that bar.txt
is missing in my version.  Something along the way to indicate that
the file and directory were removed, so that the user knows why things
look different instead of trying to recall the history.  I'll try and
think of something we could add to the message that might communicate
this better.

It's good to know, that Bazaar is doing the right thing here though.
:-)  Great job for making it work in such a tricky environment!

-John



More information about the bazaar mailing list