Part of bzrlib.config View In Hierarchy
Known subclasses: bzrlib.config._CompatibleStack
Method | __init__ | Creates a stack of sections with an optional store for changes. |
Method | get | Return the first option value found in the sections. |
Method | expand_options | Expand option references in the string in the configuration context. |
Method | set | Set a new value for the option. |
Method | remove | Remove an existing option. |
Method | __repr__ | Undocumented |
Method | _expand_options_in_string | Expand options in the string in the configuration context. |
Method | _expand_option | Undocumented |
Method | _get_mutable_section | Get the MutableSection for the Stack. |
Method | _get_overrides | Undocumented |
Parameters | sections_def | A list of Section or callables that returns an iterable of Section. This defines the Sections for the Stack and can be called repeatedly if needed. |
store | The optional Store where modifications will be recorded. If none is specified, no modifications can be done. | |
mutable_section_name | The name of the MutableSection where changes are recorded. This requires the store parameter to be specified. |
This is where we guarantee that sections coming from Store are loaded lazily: the loading is delayed until we need to either check that an option exists or get its value, which in turn may require to discover in which sections it can be defined. Both of these (section and option existence) require loading the store (even partially).
Parameters | name | The queried option. |
expand | Whether options references should be expanded. | |
Returns | The value of the option. |
Parameters | string | The string containing option(s) to expand. |
env | An option dict defining additional configuration options or overriding existing ones. | |
Returns | The expanded string. |
Parameters | string | The string to be expanded. |
env | An option dict defining additional configuration options or overriding existing ones. | |
_refs | Private list (FIFO) containing the options being expanded to detect loops. | |
Returns | The expanded string. |
This is where we guarantee that the mutable section is lazily loaded: this means we won't load the corresponding store before setting a value or deleting an option. In practice the store will often be loaded but this allows helps catching some programming errors.