Puzzled about merge conflicts.

Óscar Fuentes ofv at wanadoo.es
Mon Feb 8 14:07:37 GMT 2010


Hello Vincent.

Vincent Ladeuil <v.ladeuil+lp at free.fr> writes:

>>>>>> "Óscar" == Óscar Fuentes <ofv at wanadoo.es> writes:
>
>     Óscar> The conflicts signaled by "bzr merge" are confusing me. There is a very
>     Óscar> simple scenario: the local branch .bzrignore file is:
>
>     Óscar> ./build
>
>     Óscar> The other branch .bzrignore file is:
>
>     Óscar> ./build
>     Óscar> ./tests/log
>
> Most probably, you've added .bzrignore to both branches

Right.

> so they are seen with different file-ids by bzr (you can check that
> with 'bzr status -v
> -c<rev_where_.bzrignore_have_been_added_or_modified').
>
> It's an unfortunate side-effect of rename tracking that bzr can't
> consider them as being the same file, but that's how it works (so
> far).
>
> So bzr told you that the same path is used for two different
> files (and yes, that may have been hard to understand given they
> had both the same name :-/).
>
> From there, it's a bit harder to guess what you did, but given
> the messages below, you probably 'bzr add' the .BASE, .THIS,
> .OTHER files, adding to the confusion.

Nope. The only command executed was a `bzr merge other-branch-ur'.

[snip]

>     Óscar> Subversion merges this allright, without
>     Óscar> conflict. Bazaar, however, signals a contents
>     Óscar> conflict, leaves the original .bzrignore file
>     Óscar> untouched, and creates .bzrignore.OTHER and
>     Óscar> .bzrignore.BASE. I've tried different merge
>     Óscar> algorithms, but that didn't made a difference.
>
> 'bzr help conflict-types' is supposed to explain the different
> types of conflict,

BTW, it is `bzr help conflicts'

> I suspect that you didn't realize that a 'Content Conflict' was
> involved here .

IMO bzr should consider that a text conflict.

>     Óscar> BTW, executing "bzr remerge" produces a funny effect:
>
>     Óscar> $ ls  .bzrignore*
>     Óscar> .bzrignore  .bzrignore.BASE  .bzrignore.OTHER
>
>     Óscar> $ bzr remerge
>     Óscar> Contents conflict in .bzrignore.OTHER
>     Óscar> Conflict adding id to .bzrignore.OTHER.OTHER.  Unversioned existing file .bzrignore.OTHER.
>     Óscar> Contents conflict in tests/cases/thread/thread-wrapper.wra.OTHER
>     Óscar> Conflict adding id to tests/cases/thread/thread-wrapper.wra.OTHER.OTHER.  Unversioned existing file tests/cases/thread/thread-wrapper.wra.OTHER.
>     Óscar> Contents conflict in tests/wrappers/defdatems.lp0.OTHER
>     Óscar> Conflict adding id to tests/wrappers/defdatems.lp0.OTHER.OTHER.  Unversioned existing file tests/wrappers/defdatems.lp0.OTHER.
>     Óscar> 6 conflicts encountered.
>
>     Óscar> $ ls  .bzrignore*
>     Óscar> .bzrignore  .bzrignore.OTHER.BASE  .bzrignore.OTHER.OTHER
>
> Yup, no '.THIS' file, so that's not a 'Text Conflict' but indeed
> a 'Content Conflict', you're trying to merge two different files
> (they have different file-ids) into the same path (yes, they have
> the same paths in both branches, yet bzr doesn't see them as the
> same file as mentioned above).

Sorry for not being more explicit, but the "funny effect" I was trying
to describe above was the transformation of `.bzrignore.OTHER' into
`.bzrignore.OTHER.OTHER' after the remerge. A subsequent remerge will
rename it to `.bzrignore.OTHER.OTHER.OTHER', etc. It was funny too to
see how bzr complains about conflicts on the files he himself created
(the *.OTHER and *.BASE files). It clearly smells like a bug there.

Thanks for your comments.




More information about the bazaar mailing list