[MERGE] Config.get_user_section() API

Robert Collins robertc at robertcollins.net
Tue Feb 5 02:01:11 GMT 2008


On Tue, 2008-02-05 at 11:25 +1000, Ian Clatworthy wrote:
> 
> That is better than what we currently have ('write a plugin') but it
> doesn't scale. As explained in http://bazaar-vcs.org/BzrHooks, Hg gets
> around this by using an optional tagging syntax:

I really object to this claim. Its not better than what we have. Its
different. It falls over really badly in sufficiently many ways that *I*
don't want to have to deal with bug reports that /will/ result from
having it in the core.

> [hooks]
> pre-export = make docs
> pre-export.foo = make foo
> 
> I don't like that - I much prefer the way I'm proposing. Either way, a
> get_user_section() API is needed to find the complete set of hooks.
> 
> The API is also extremely useful within a given hook or plugin. If I'm
> writing an ACL hook say, there's every chance I'll want to do
> something
> like this to get the configuration settings:
> 
>   settings = cfg.get_user_section('acl-settings')
> 
> It's true that plugins can create and use their own config files but
> there are times when reusing the standard config infrastructure by
> adding new sections works better.

Plugins don't need to create their own config file in the examples that
have been handed around in the threads to date - see bzr-email for
instance, or bzr-pqm, or bzr-gtk, or bzr-avahi, or bzr-$PLUGIN.

-Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080205/6fac9f90/attachment.pgp 


More information about the bazaar mailing list