[PATCH] more work on merge

Aaron Bentley aaron.bentley at utoronto.ca
Sun Jul 10 17:47:05 BST 2005


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

John A Meinel wrote:
> Aaron Bentley wrote:
> 
>> I've been working on computing the most recent common ancestor out of
>> all ancestors, but it's taking a while to get right.
> 
> 
> Did you see my work in the merge plugin? Is there a reason my method was
> not correct?

Mostly, I forgot about it.  Tunnel-vision, you know.  Martin told me
he'd implemented add_pending_merge(), and seemed to be holding back on
applying it to the code because I was working on merge.  So I figured I
should apply it, and I started writing the things I'd need.

> Perhaps it was just too slow.

Slow but right is okay by me.  I was going to implement something
potentially slow and then let someone write a faster implementation if &
when it mattered.

> My method was to get the list
> of all revisions in the TO branch, and then search breadth-first into
> the FROM branch until I found a revision which existed in both.

This sounds like a workable approach.  I don't think it detects the
crossed-branches case, at least not out of the box.

If A merges B, and B merges A, and then they both commit, then the next
time you merge, you get two equally good candidate bases.  See this post
for the same problem in an Arch context:
http://lists.gnu.org/archive/html/gnu-arch-users/2004-09/msg00279.html

I think the best thing to do in that case is to select an earlier base.
 But this is the sort of situation that Codeville Merge handles gracefully.

What I've been working on would be somewhat slower than your approach,
but a bit more rigorous.  First getting the full ancestry of both A and
B, finding their set intersection, and then picking the revision in the
intersection that is closest to A and closest to B, if there is such a
thing.

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

iD8DBQFC0VEJ0F+nu1YWqI0RAvpEAJ4iKPo+Q+YuoVrxzgGJMKXifpOzWQCfcxMb
aLkByoTxPagykAfEtmiAiUc=
=yXh0
-----END PGP SIGNATURE-----




More information about the bazaar mailing list