b.config : module documentation

Part of bzrlib

Configuration that affects the behaviour of Bazaar.

Currently this configuration resides in ~/.bazaar/bazaar.conf
and ~/.bazaar/locations.conf, which is written to by bzr.

In bazaar.conf the following options may be set:
[DEFAULT]
editor=name-of-program
email=Your Name <your@email.address>
check_signatures=require|ignore|check-available(default)
create_signatures=always|never|when-required(default)
gpg_signing_command=name-of-program
log_format=name-of-format

in locations.conf, you specify the url of a branch and options for it.
Wildcards may be used - * and ? as normal in shell completion. Options
set in both bazaar.conf and locations.conf are overridden by the locations.conf
setting.
[/home/robertc/source]
recurse=False|True(default)
email= as above
check_signatures= as above
create_signatures= as above.

explanation of options
----------------------
editor - this option sets the pop up editor to use during commits.
email - this option sets the user id bzr will use when committing.
check_signatures - this option controls whether bzr will require good gpg
                   signatures, ignore them, or check them if they are
                   present.
create_signatures - this option controls whether bzr will always create
                    gpg signatures, never create them, or create them if the
                    branch is configured to require them.
log_format - this option sets the default log format.  Possible values are
             long, short, line, or a plugin can register new formats.

In bazaar.conf you can also define aliases in the ALIASES sections, example

[ALIASES]
lastlog=log --line -r-10..-1
ll=log --line -r-10..-1
h=help
up=pull
Function ConfigObj Undocumented
Class Config A configuration policy - what username, editor, gpg needs etc.
Class IniBasedConfig A configuration policy that draws from ini files.
Class GlobalConfig The configuration that should be used for a specific location.
Class LocationConfig A configuration object that gives the policy for a location.
Class BranchConfig A configuration object giving the policy for a branch.
Function ensure_config_dir_exists Make sure a configuration directory exists.
Function config_dir Return per-user configuration directory.
Function config_filename Return per-user configuration ini file filename.
Function branches_config_filename Return per-user configuration ini file filename.
Function locations_config_filename Return per-user configuration ini file filename.
Function authentication_config_filename Return per-user authentication ini file filename.
Function user_ignore_config_filename Return the user default ignore filename
Function crash_dir Return the directory name to store crash files.
Function xdg_cache_dir Undocumented
Function parse_username Parse e-mail username and return a (name, address) tuple.
Function extract_email_address Return just the address part of an email string.
Class TreeConfig Branch configuration data associated with its contents, not location
Class AuthenticationConfig The authentication configuration file based on a ini file.
Class CredentialStoreRegistry A class that registers credential stores.
Class CredentialStore An abstract class to implement storage for credentials
Class PlainTextCredentialStore Plain text credential store for the authentication.conf file.
Class BzrDirConfig No class docstring; 2/3 methods documented
Class TransportConfig A Config that reads/writes a config file on a Transport.
Function _auto_user_id Calculate automatic user identification.
def ConfigObj(*args, **kwargs):
Undocumented
def ensure_config_dir_exists(path=None):
Make sure a configuration directory exists. This makes sure that the directory exists. On windows, since configuration directories are 2 levels deep, it makes sure both the directory and the parent directory exists.
def config_dir():
Return per-user configuration directory.

By default this is ~/.bazaar/

TODO: Global option --config-dir to override this.

def config_filename():
Return per-user configuration ini file filename.
def branches_config_filename():
Return per-user configuration ini file filename.
def locations_config_filename():
Return per-user configuration ini file filename.
def authentication_config_filename():
Return per-user authentication ini file filename.
def user_ignore_config_filename():
Return the user default ignore filename
def crash_dir():
Return the directory name to store crash files.

This doesn't implicitly create it.

On Windows it's in the config directory; elsewhere it's /var/crash which may be monitored by apport. It can be overridden by $APPORT_CRASH_DIR.

def xdg_cache_dir():
Undocumented
def _auto_user_id():
Calculate automatic user identification.

Returns (realname, email).

Only used when none is set in the environment or the id file.

This previously used the FQDN as the default domain, but that can be very slow on machines where DNS is broken. So now we simply use the hostname.

def parse_username(username):
Parse e-mail username and return a (name, address) tuple.
def extract_email_address(e):

Return just the address part of an email string.

That is just the user@domain part, nothing else. This part is required to contain only ascii characters. If it can't be extracted, raises an error.

>>> extract_email_address('Jane Tester <jane@test.com>')
"jane@test.com"
API Documentation for Bazaar, generated by pydoctor at 2010-03-11 00:10:04.