locations.conf ideas?

Aaron Bentley aaron at aaronbentley.com
Sat Jul 4 16:33:15 BST 2009


Jonathan Lange wrote:
> To make everything work nicely, we ended up manually editing
> locations.conf to look an awful lot like this:
> 
> [/home/jml/src/bzr]
> submit_branch = /home/jml/src/bzr/bzr.dev
> public_branch = lp:~jml/bzr
> public_branch:policy = appendpath
> push_location = lp:~jml/bzr
> push_location:policy = appendpath
> submit_to = bazaar at lists.canonical.com
> 
> [/home/jml/src/bzr/trunk]
> public_branch = lp:bzr

I assume you mean [/home/jml/src/bzr/bzr.dev]

> Is there something we could have done that would have been simpler
> than that? If not, what can we do to make it simpler?

I don't think it's strictly necessary to provide submit_branch, as this
will fall back to parent, which will be /home/jml/src/bzr/bzr.dev anyway.

We could make public_branch the default push location.  For cases where
the public_location is not writeable, you could still specify
push_location for the writeable location.

The bzrtools create-mirror command will automatically set the
public_branch value.  I'll make it copy the child_submit_to value as
well, but for this to work, it needs to be set on
http://bazaar-vcs.org/bzr/bzr.dev.

So we can easily eliminate setting the "submit_to" value using
create-mirror.  The public_branch is more problematic because the your
"public_branch = lp:~jml/bzr" value in locations.conf will override the
value set in .bzr/branch/branch.conf by create-mirror.

We've deliberately given precedence to locations.conf because the user
may have no control over branch.conf, but perhaps we should consider
making locations.conf only override the branch.conf value if configured
to do so, with public_branch:policy=override or something similar.

In a similar vein, there are ways we could make it easier to specify the
appendpath policy
 - make it the default
 - make it the default, only for values that indicate locations
 - specify policies with metacharacters, such as + for appendpath
   "public_branch+=lp:~jml/bzr"
 - allow substitution of values:
   "public_branch=lp:~jml/bzr/$PATH"


So by changing the behaviour of create-mirror and the config mechanism,
we could get it down to:

[/home/jml/src/bzr]
public_branch+ = lp:~jml/bzr

The following config values will have been set by create-mirror:
public_branch = http://bazaar-vcs.org/bzr/bzr.dev
child_submit_to = bazaar at lists.canonical.com

What do you think of that?

Of course, it would be easier to provide a plugin that just set up good
defaults for working with a project.  I understand you've already
travelled down that road, so I assume that kind of solution doesn't appeal.

Aaron




More information about the bazaar mailing list