[PATCH] configuration policies
John Arbash Meinel
john at arbash-meinel.com
Fri Nov 10 22:03:35 GMT 2006
James Henstridge wrote:
> On 07/11/06, James Henstridge <james at jamesh.id.au> wrote:
>> The attached bundle implements configuration polcies. The main new
>> features are:
>>
>> * support the equivalent of recurse=False for a subset of options in a
>> section
>> * have an "append path" policy allowing for e.g. a single
>> push_location setting for an entire tree of branches.
>>
>> The branch maintains support for recurse=False option in sections, but
>> will convert it to a "policy_norecurse" key if bzr writes to the
>> section.
>
> Attached is an updated version of the patch, based on feedback from
> Aaron and John on IRC. It now uses one key per option to specify
> policy rather than one key per policy.
>
> As an example of use of the plugin, consider the case of someone using
> bzr to work on a project that uses PQM. They maintain a local copy of
> the branches, with a mirror at a public location. There are multiple
> products they can submit merges to, and they organise branches for
> each product under different subdirectories. This patch would allow
> the following minimal setup:
>
> [/path/to/repo]
> pqm_email = pqm at example.com
> push_location = bzr+ssh://publichost/~/public_html/repo
> push_location:policy = appendpath
> public_branch = http://publichost/~user/repo
> public_branch:policy = appendpath
>
> [/path/to/repo/product1]
> pqm_branch = http://example.com/product1
> [/path/to/repo/product2]
> pqm_branch = http://example.com/product2
>
> This will make "bzr push" do the right thing for any local branches
> under /path/to/repo, and "bzr pqm-submit" will also work, picking the
> PQM target branch based on the subdirectory where the branch is
> stored.
>
> James.
>
I like the syntax. Though I'm curious about
1) Is it compatible? (As in with current settings will users experience
weird differences if they aren't aware of this switch).
It seems like it is compatible, as you have to explicitly set :policy =XX
2) If you do 'bzr push' does it end up creating a new entry? I'm
guessing it doesn't since the code is generally:
saved_loc = config.get_push_location()
if saved_loc is None:
or
if config.get_push_location() is None:
If that isn't the case, we may need to think about it. Because it means
the policy starts breaking for nested entries. But I *think* it will
just work correctly.
Overall, I think I'm quite pleased with the changes. And while I haven't
used a fine tooth comb over the code, I think it is worthy of merging.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061110/ebd5d516/attachment.pgp
More information about the bazaar
mailing list