Change the file-id of the root

James Westby jw+debian at jameswestby.net
Fri Sep 11 15:39:22 BST 2009


On Fri Sep 11 14:27:02 +0100 2009 Aaron Bentley wrote:
> That seems unusual.  Wouldn't you want to make one a subtree of the
> other?  You really want to merge them so that their root directories are
> a combination of the contents of both trees?

Yes, we really want this. They are known to be conceptually the
same "project" (in this case package), we just can't represent
the history they share in bzr without bad things happening.

This is basically a workaround for the parallel imports problem. We
want these trees to merge without conflicting on everything where
we can, so there is already code to do essentially "add --file-ids-from"
when new files are added, but this doesn't help for the root, as
the root file-id is set as soon as the tree is created, so there is
no point at which we explicitly add it and so select the file id.

> > My question is, what is the best way to achieve this? There doesn't
> > seem to be an interface to change the id of the root

> The interface is WorkingTree.set_root_id.

Thanks. I should be able to make this work with that.

> > so I am guessing
> > the best way is to somehow initialise the tree from the other. Is there
> > a way to do a "branch" operation that uses the file-id for the root,
> > but leaves the new branch with an empty history?
> 
> An empty branch doesn't have a root, so it doesn't have a root id.  But
> you can set the root ID of the WorkingTree associated with a branch.

Sorry, mixing my terms there.

Thanks,

James



More information about the bazaar mailing list