[BUG] apply_changeset / generate_changeset use wrong base

John A Meinel john at arbash-meinel.com
Tue Sep 27 15:48:12 BST 2005


Aaron Bentley wrote:
> Hi all,
> 
> When applying a changeset, apply-changeset uses the changeset base as
> its base.  But the changeset base isn't always the right choice.
> 
> If a changeset is generated with reference to the target branch, the
> latest revision in the target branch is selected as the base.

Yes, this I know of this limitation in the current implementation. There 
is even a comment in "apply_changeset" which states this. See line 108. 
I think the trick would just be to call:

base = common_ancestor(cset_info.target, branch.last_patch())

merge_revs(branch, base, cset_info.target)

I don't know the exact syntax to common_ancestor, but that should be all 
it takes to get the correct base.

John
=:->

> 
> For a concrete example...
> 
> With Robert's integration (as of 1227) and my bzr.24 (as of 1086):
> $ cd bzr.integration
> $ bzr changeset ../bzr.24 > ~/integration.patch
> 
> This produces a changeset whose base is
> abentley at panoramicfeedback.com-20050926150316-ed498650ab07a6ce
> 
> When this changeset is applied, it transforms my working tree into
> robert's, losing the changes I've committed.
> 
> However,
> $ bzr find-merge-base . ../bzr.24
> merge base is revision
> robertc at robertcollins.net-20050923085416-c24f9ae97742896f
> 
> Either we need to use common-ancestor to select the changeset base, or
> we need to determine merge base independently of the changeset base.  I
> prefer the second option.
> 
> Aaron
-------------- 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/20050927/4501faba/attachment.pgp 


More information about the bazaar mailing list