[MERGE][BUG #151731] Alternative Cherrypicking merges

John Arbash Meinel john at arbash-meinel.com
Tue Mar 4 14:30:23 GMT 2008


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

I've been thinking about the cherrypicking bug:
https://bugs.launchpad.net/bzr/+bug/151731

My notes on the bug are probably unclear, so I'll try to summarize, and
present an alternative to 3-way merge that might work very well for
cherrypicks.

To describe what is happening now, lets try an example (these are the
lines of the files):

  THIS    BASE    OTHER
  foo     foo     foo
          bar     bar
                  baz

The way 3-way merge works, it finds that "foo" is common between the 3
versions, and then conflicts on the rest of the ranges. (Because THIS !=
BASE and OTHER != BASE.)

For normal 3-way merging, the conflict will include both "bar" and
"baz", which is a sensible thing to do. (When merging the change to
include 'baz' it may not make any sense without the context of 'bar').

When cherrypicking, you are making more of an explicit statement that
you *don't* want the context. So my proposal is to start with the 3-way
merge logic to find conflict regions. However, when resolving the
conflicts, you can do another region matching and ignore the lines which
are already present in base.

It turns out we already had code to detect when it was a cherrypick, and
that is used to trigger the alternative form.
It also exposed that the trees were not being locked before our
is_ancestor checks, and a few other small bugfixes.

If we do decide to do this, I should probably put a NEWS entry for bug
#151731.

John
=:->

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

iD8DBQFHzVz/JdeBCYSNAAMRAorLAJ9pNL04yHf/tCx8xjxBFnuaT5Lw7ACg1zqJ
Dzyv0+Sd3VDkWAU6jmADnkg=
=oSuK
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cherrypick_merge.patch
Type: text/x-diff
Size: 22258 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080304/da3e9b2d/attachment-0001.bin 


More information about the bazaar mailing list