Discussion about merging

John A Meinel john at arbash-meinel.com
Fri Jun 3 23:27:31 BST 2005


Aaron Bentley wrote:

...

> Finding the common base should be a symmetrical operation.  It shouldn't
> matter whether you're merging A into B or B into A.
>
> So I think this can work:
> 1. get an iterator of revisions in A
> 2. get an iterator of revisions in B
> 3. get the next A revision

When you say "next" here, I assume you mean previous. (ie start at
revision 600, 'next' = 599).

> 4. see if it merged any revisions in B-ANCESTORS.  If so, set it as
> A-BASE and stop iteration through B

Isn't this step 'for merged in cur_A.merges: for ancestor of
curB.ancestors: is merged == ancestor'?
You can make it a little faster by keeping a hash/dict of curB.ancestors.

> 5. see if it is listed in B-MERGES.  If so, set the revision that merged
> it as A-BASE and stop iteration through A

> 6. add it to A-ANCESTORS

Isn't this saying start at 1 and go to 600? Which means you have to go
through all of the ancestry? (Because you want the newest merge point,
not the oldest).

> 7. add its merges to A-MERGES
> 8. get the next B revision
> 9. see if it merged any revisions in A-ANCESTORS.  If so, set the
> revision as B-BASE, and stop iteration through A
> 10. see if it is listed in A-MERGES.  If so, set it as B-BASE and stop
> iteration through B
> 11. add it to B-ANCESTORS
> 12. add its merges to B-MERGES
> 13. goto 3
> 14. compare A-BASE and B-BASE to see which merged the other.
>
John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050603/b035d575/attachment.pgp 


More information about the bazaar mailing list