what to use to replace bzrlib.changeset?

Jamie Wilkinson jaq at spacepants.org
Tue Mar 7 01:23:21 GMT 2006


This one time, at band camp, Aaron Bentley wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Jamie Wilkinson wrote:
>| This one time, at band camp, Aaron Bentley wrote:
>|>I suspect your use case is best handled with merge, which
>|>compares two revisions, and applies new changes to a third.
>
>| The problem I had using the merge code last time is that it expected that
>| both the merge source and destination branches had a common ancestor
>
>No, that's not required.  You can get some very useful effects by
>specifying a base that is not a common ancestor.  For example, if you
>want to apply the changes introduced by revno 6, you can do 'bzr merge
>- -r 5..6'.

Are you merging revno 6 back into the same branch?  That seems... more evil
than the graft plugin :)

But bzr internally knows that a revno on one branch can be merged into
another branch, because the two branches can be traced back to one parent.
At least, that's my understanding of it.  Are you saying merge will actually
let you merge from one branch to another *even if* they don't share a common
ancestor?

The graft plugin was designed specifically for the case where:

  A
  |
  B   B'
      |
      C

the same software was tracked in two different VCSes in the past, and an
incomplete migration was done from the first to the second -- i.e. the
second just imported the latest code without any prior history -- and that
the user wants to retain all of the project's history in a single bzr
branch.

>I think what you actually want is to reproduce a series of tree-states,
>committing each as a new revision.  If that's right, then
>bzrlib.merge.tree_transform should do the trick.

Yeah.

>If you need your tree-states to vary from the original ones, then you
>simply need to iterate through the revision history, specifying the
>previous revision as the base for the current one, each time.

I think that's close to analogous to what I was doing with changesets in
graft earlier.  Thanks for the tips.




More information about the bazaar mailing list