Module b.config

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
Line # Kind Name Docs
125 Function ConfigObj Undocumented
145 Class Config A configuration policy - what username, editor, gpg needs etc.
298 Class IniBasedConfig A configuration policy that draws from ini files.
425 Class GlobalConfig The configuration that should be used for a specific location.
471 Class LocationConfig A configuration object that gives the policy for a location.
612 Class BranchConfig A configuration object giving the policy for a branch.
748 Function ensure_config_dir_exists Make sure a configuration directory exists.
766 Function config_dir Return per-user configuration directory.
790 Function config_filename Return per-user configuration ini file filename.
795 Function branches_config_filename Return per-user configuration ini file filename.
800 Function locations_config_filename Return per-user configuration ini file filename.
805 Function authentication_config_filename Return per-user authentication ini file filename.
810 Function user_ignore_config_filename Return the user default ignore filename
888 Function parse_username Parse e-mail username and return a (name, address) tuple.
897 Function extract_email_address Return just the address part of an email string.
913 Class TreeConfig Branch configuration data associated with its contents, not location
947 Class AuthenticationConfig The authentication configuration file based on a ini file.
1182 Class BzrDirConfig No class docstring; 2/3 methods documented
1214 Class TransportConfig A Config that reads/writes a config file on a Transport.
815 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 _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 BzrLib, generated by pydoctor at 2008-12-03 00:00:12.