What do I call a working tree that stores its revisions in a shared repository?
Andrew Bennetts
andrew at canonical.com
Tue Apr 1 07:32:28 BST 2008
Stefan Monnier wrote:
[...]
> Not sure how that would work since it seems this requires to still have
> a branch underneath the repository. Are you suggesting something like:
>
> bzr repo-init ~/var/bzr-foo
> bzr clone <bar> ~/var/bzr-foo/bar
> (cd ~/var/bzr-foo/bar; bzr remove-tree)
> bzr checkout --lightweight ~/var/bzr-foo/bar <anywhere>
>
> Would this work?
Nearly, except for what James says: use --no-trees:
bzr init-repo --no-trees ~/var/bzr-foo
bzr clone <bzr> ~/var/bzr-foo/bzr
bzr checkout --lightweight ~/var/bzr-foo/bar <anywhere>
> The thing is: I don't have a clear enough understanding of lightweight
> checkouts to figure out whether it would behave identically to what
> I proposed (what happens when you do `bzr merge', `bzr pull', `bzr
> push'?).
It'll work better than your proposal, which as you noted, breaks the branch
because it can no longer find any history.
To understand the behaviour, without --no-trees, when you make a branch in a
shared repository, that branch is co-located with a working tree. With the
above method, the working tree for the branch is located anywhere you like, but
the behaviour of bzr commands on that working tree are just the same as if it
were co-located. So "bzr commit" in a checkout writes the commit directly to
the branch, for instance.
(You might also be interested in "bzr cbranch", a command added by the bzrtools
plugin, which can create a new branch in a repository and a new checkout for
that branch at the same time.)
-Andrew.
More information about the bazaar
mailing list