Stacking policy
Stefan Monnier
monnier at iro.umontreal.ca
Wed Apr 2 17:22:05 BST 2008
>> Is there a reason that you don't want to leave it up to shared-repos
>> and points 0 and 1 to do what the user wants?
Using stacking by default when branching on local filesystems as in
bzr branch bzr.dev /foo/bar
just doesn't sound like a good idea:
- it's never clear how do you refer from /foo/bar to bzr.dev:
should you use `pwd`/bzr.dev? Should you try to use a relative name?
Either choice may fail to work.
- it creates a link between the two, so moving those branches may
break it, and of course deleting bzr.dev will break /foo/bar.
When working across hosts, it might make sense to use stacking by
default (although you'd first want to make sure that Bzr can use the
branch even when the remote host is unavailable).
Whichever default is chosen, it might be a good idea to provide
a half-way solution in the form of a --lazy flag: it would create
a stacked branch, and then just before returning, it would fork a `bzr
reconfigure' to make the branch non-stacked.
> Bazaar is being perceived as slow because its default mode of operation
> is slow. People don't learn about the extra configuration required to
> make it fast, or don't bother doing it, so they get this impression.
"Automatically" setting up shared repositories would help a lot for
local branching, and in a much better way than stacking.
Not sure how to do it, tho. Here are some ideas (non-mutually exclusive):
- make it harder for the user to not use shared repositories.
E.g. only allow a local "bzr branch" to create a non-shared
repository after providing a --non-shared or --force argument.
Monotone simply doesn't support non-shared repositories.
- allow sharing repositories that aren't in a parent dir. This actually
already seems to work: you can make ~/.bzr/repository a symlink to the
repository.
- let bazaar.conf specify a repository-area (e.g. ~/var/bzr). Then when
creating a new branch, try to share the branch's repository like we do
now, and if that fails, check if the branch's repository is in the
repository-area, if so share it, if not check every repository in the
repository area and see if one is "related" to the branch
(e.g. contains the root revid?), and finally if that fails, create
a new repository in that area.
> I don't think being slow is a good default. Stacking doesn't require
> extra configuration, so it's a way of being fast by default.
But its semantics is not as nice.
Stefan
More information about the bazaar
mailing list