Non-expected conflict

Aaron Bentley aaron.bentley at utoronto.ca
Wed Mar 22 01:00:01 GMT 2006


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

Hi Gustavo,

Gustavo Niemeyer wrote:
| Running bzr blame on the current revision (79) of branch-chris
| still shows that Chris is using Gustavo's code:

Giving bzr blame output isn't relevant, because we don't use this
information for doing a merge (except weave merge, which is not the
default and is broken in bzr.dev).

It would be much more helpful to provide excerpts from the THIS BASE and
OTHER files, because those are the inputs to the merge algorithm.

I think comparison of THIS, BASE, and OTHER would show that the
algorithm is performing reasonably well.  You could also try using
- --reprocess for merging, which should reduce the conflict regions to:

if __name__ == "__main__":
<<<<<<< TREE
~    runner = os.environ.get("TEST_RUNNER")
~    if not runner:
~        runner = "unittest"
=======
~    runner = os.environ.get("TEST_RUNNER", "unittest")
|>>>>>> MERGE-SOURCE
~    runner_func = globals().get("test_with_%s" % runner)
~    if not runner_func:
~        sys.exit("Test runner not found: %s" % runner)
~    runner_func()

| Now, what should happen if Gustavo bzr merge'd from branch-chris into
| branch-gustavo?  Gustavo was the only one to work on that code, so his
| code should just be preserved, but that's not what bzr is doing:

Here's what I think this is happening.  I think your merge history can
be simplified for these purposes like so:
http://aaronbentley.com/pastegraph.cgi?n=198

As in your graph-ancestry output, R73 is the merge base.  The R line is
Chris' branch, and the r line is Gustavo's.

R73 lacks the changes that were introduced by r61, but R79 has those
changes.  So relative to R73, R79 introduces Gustavo's r61 changes (and
others).  And relative to R79, r72 introduces r61 and onward.  Some of
these later changes conflict with the ones in r61, and this is why you
get conflicts in code originated in the same branch.

Or, to make a long story short, it's a criss-cross merge.  R61 should
have been chosen as the base.  But if it had been, you would still get
conflicts here because R61's text for this region won't match Gustavo's
or Chris'.

Which is exactly where weave merge would rock, if it wasn't busted.

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

iD8DBQFEIKGR0F+nu1YWqI0RAmh5AJ4hl/JVf6zJ6IqvqL2Z8g1FZVLbswCfcLZg
uUmwmXfyEfpl+Imm5PVaqIA=
=pZsy
-----END PGP SIGNATURE-----




More information about the bazaar mailing list