Sharing repository across branches
James Westby
jw+debian at jameswestby.net
Mon Mar 31 20:22:49 BST 2008
On Mon, 2008-03-31 at 15:13 -0400, Stefan Monnier wrote:
> >> 2 - Say I have a branch with its own repository and I want to create
> >> another branch and share the repository. How can I do that?
> >> Is there a way to move a branch's repository up the tree (or move
> >> the branch down without moving the repository), or do I have to
> >> do it the expensive way (which recreates a completely new
> >> repository from the existing one)?
> >>
>
> > No, there's currently no way of doing this.
>
> How odd. I'd have expected that moving the "repository" subdirectory of
> .bzr is all that's needed.
Well, ok, yes, just mv .bzr/repository will probably work fine.
There no way to do this at the bzr UI level.
>
> > However, the discussion is over how it should be done, as you need
> > to either keep the repository where it is and move the branch down,
> > or move the repository up. Each of them have their problematic
> > cases to deal with.
>
> Doesn't seem particularly difficult, as long as you accept that it only
> works in some cases (e.g. the parent dir doesn't have a .bzr yet).
>
Well, the parent dir having anything else in it at all may
lead to an unexpected situation for the user.
> > Would you like me to explain how to do this by hand?
>
> Yes, please.
Ok, so first you need to create the shared repository that you are
going to end up with everything it
bzr init-repo temp
now branch the branch that you want to use the repository of in to
it
bzr branch wherever temp/wherever
Now remove the old branch
rm wherever
and then simply "mv temp" to wherever you want, and branch any
other branches you want in.
There are various permutations of this that you can probably come
up with. Also, it sounds like you are more interested in moving
the repository to the parent, than moving the branch down a level,
which means that you will have to take care of moving any other
files in to the new repository and then moving it in to place of the
old one.
Thanks,
James
More information about the bazaar
mailing list