9
9
* a value: a unicode string or a list of unicode strings.
14
As a Bazaar developer there are three things you need to know about
17
1: To get a value, you construct or get a reference to a ConfigStack
18
subclass that's relevant to the context where you want to look up a value.
19
For instance, given a branch::
21
print branch.get_config_stack().get('log_format')
23
This will look up the stack through all relevant configuration sources.
24
The value returned is of the type declared for that Option and if nothing
25
is specifically declared you will get the default for that option.
27
2: To add a new option, you add a new `Option` to the `option_registry`,
28
either inside ``bzrlib/config.py`` or during initialization of your
29
plugin. New plugins should have systematic hierarchical names so that
30
related values are grouped together. ::
32
option_registry.register(
33
Option('dirstate.fdatasync', default=True,
34
from_unicode=bool_from_store,
35
help="Flush dirstate changes onto physical disk? ...."))
37
3: There is (as of late 2011) some older and some newer configuration
38
code. The old code has specific methods for various checks or uses
39
classes like `GlobalConfig`. Don't add to to it; try to remove it.