[PATCH] cascading lookup support in LocationConfig (bug 33430)

John Arbash Meinel john at arbash-meinel.com
Thu Sep 14 22:13:40 BST 2006


Aaron Bentley wrote:

...

>>>> I think BranchConfig should set policy about whether particular values
>>>> cascade.
>>> Then we'd need some way for other code to register what policy is
>>> desired for particular keys.
> 
> Let me stop here and say I don't mean "particular keys" per se.  I mean
> particular configuration values.
> 
> So, for example, the policy for the user_id is set like this:
> 
>     def _get_user_id(self):
>         """Return the full user id for the branch.
> 
>         e.g. "John Hacker <jhacker at foo.org>"
>         This is looked up in the email controlfile for the branch.
>         """
>         try:
>             return (self.branch.control_files.get_utf8("email")
>                     .read()
>                     .decode(bzrlib.user_encoding)
>                     .rstrip("\r\n"))
>         except errors.NoSuchFile, e:
>             pass
> 
>         return self._get_best_value('_get_user_id')
> 
> But if you do branch_config.get_user_option('email'), it won't check the
> 'email' control file.  BranchConfig sets policy for the 'user_id' config
> value, not the 'email' key.
> 
> Plugins don't need to set policy, because their config values are not
> reused by other code.  They can just choose the policy they want when
> they get/set the value.  (or, they *ought* to be able to)
> 
> But if they want to set policy for their own use, they can subclass
> BranchConfig, as pqm-submit does.

Well, 'pqm-submit' no longer subclasses BranchConfig, instead just using
'get_user_setting()' for all of the pieces. Though the official name is
now 'bzr-pqm' and is set up at:
https://launchpad.net/products/bzr-pqm

But anyway... What is the status of the changes? Any chance to get them
reviewed for 0.11? (That really means we need 2 reviews by tomorrow, so
timing may be a little bit tight).

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/20060914/807d0765/attachment.pgp 


More information about the bazaar mailing list