[rfc] conflicts in merge sometimes looks strange

Aaron Bentley aaron.bentley at utoronto.ca
Wed Nov 29 13:07:48 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> I try to understand how bzr produce conflict texts.
> Sometimes during merge there is very strange conflicts. Per example:
> 
>  self.log.clear()
>  <<<<<<< TREE
>  libgame.dll.get_game_log(libgame.LogVariant['ELOG_normal'], bufgamelog)
>  self.log.add_game_log(bufgamelog.value)
>  ||||||| BASE-REVISION
>  =======
>  libgame.dll.get_game_log(libgame.LogVariant['ELOG_normal'], bufgamelog)
>  self.log.add('game_log: ' + bufgamelog.value)
>  >>>>>>> MERGE-SOURCE
>  self.log.add_line(linenum, line)
> 
> 
> There is added 2 lines in both branches, but actual conflict only in second
> line, because only second line differs. But bzr show both lines in conflict.
> 
> Why?

By default, merging is done on a per-block basis.  The block begins
where the texts start to differ from the base text.  It ends where the
texts match the base text again.

If the block were identical for TREE and MERGE-SOURCE, there would be no
conflict.  Since they differ, the whole block conflicts.

You can avoid this behavior by specifying --reprocess, which scans the
blocks for common text.  It's impossible to do that and show base,
though, because it obscures the relationship between conflicting regions
and the base text.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFbYYk0F+nu1YWqI0RAsSCAKCICwoIVJGtoRVDCr1A79BcU67BbwCeJsfO
wzsGWtWOIXXuuttVP7T0fVA=
=E49a
-----END PGP SIGNATURE-----




More information about the bazaar mailing list