Bazaar

Bazaar

 




Wiki Tools

  • Login
  • Create Profile
  • FindPage
  • RecentChanges
  • Page History
  • Attachments

  • Status: Updated for Bazaar-NG 0.9-pre. branches.conf have now been renamed to locations.conf, the user should rename the file manually.

Configuration files

Location of configuration file

Each user can create a pair of configuration files in $HOME/.bazaar (or %APPDATA%\bazaar\2.0 on Windows). The first one, named bazaar.conf, includes default configuration options. The other file, locations.conf (was branches.conf for bzr <= 0.8), contains configuration information for branches, according to their location.

Each branch can also contain .bzr/branch/branch.conf, which stores information about the branch in the branch itself.

Except as noted, all options can be stored in any of these files. The order of preference is:

  1. branch.conf
  2. locations.conf
  3. bazaar.conf

For security reasons, some options are not permitted in branch.conf. (This is noted in their descriptions.) For example, the postcommit and gpg_signing_command options allow an arbitrary operation to be specified. If an attacker changed the contents of branch.conf, they could cause malicious code to be executed on the next commit.

General Format

An ini file has three types of constructs: section headers, section variables and comments.

comment

A comment is any line that starts with a "#" (sometimes called a "hash mark", "pound sign" or "number sign"). Comment lines are ignored by Bazaar-NG when parsing ini files.

section header

A section header is a word enclosed in brackets that starts at the beginning of a line, typical section headers look like this:

  • For bazaar.conf, the only valid section header is [DEFAULT], which is case sensitive. The default section provides for setting variables which can be overridden with the later method:

[DEFAULT]
  • For locations.conf, the variables from the section with the longest matching section header are used to the exclusion of other potentially valid section headers. A section header uses the path for the branch as the section header. Some examples include:

[http://mybranches.isp.com/~jdoe/branchdir]
[/home/jdoe/branches/]
[file:///home/jdoe/my-branches/*]

section variables

A section variable resides within a section. A section variable contains a variable name, an equals sign and a value. It generally takes the following form:

email            = John Doe <jdoe@isp.com>
check_signatures = require

The main configuration file, bazaar.conf

The main configuration file, $HOME/.bazaar/bazaar.conf, permits one section called [DEFAULT]. This default section contains the default configuration options for all branches.

A typical bazaar.conf section often looks like the following:

[DEFAULT]
email             = John Doe <jdoe@isp.com>
editor            = /usr/bin/vim
check_signatures  = check-available
create_signatures = when-required

$HOME/.bazaar/locations.conf allows one to specify overriding settings for a specific branch. The format is almost identical to the default section in bazaar.conf with one significant change: The section header, instead of saying default, will be the path to a branch that you wish to override a value for. The ? and * wildcards are supported:

[/home/jdoe/branches/nethack]
email = Nethack Admin <nethack@nethack.com>

[http://hypothetical.site.com/branches/devel-branch]
create_signatures = always
check_signatures  = always

[http://bazaar-ng.org/bzr/*]
check_signatures  = require

Common Variable options

email

The email address to use when committing a branch. Typically takes the form of Full Name <account@hostname.tld>. Other choices on how to set your commit email address can be seen on BzrSettingEmail.

editor

The path of the editor that you wish to use if bzr commit is run without a commit log message. This value overrides the editor specified in the $VISUAL or $EDITOR environmental variables, and is itself overridden by $BZR_EDITOR.

check_signatures

Defines the behavior for signatures.

  • require - The gnupg signature for revisions must be present and must be valid.

  • ignore - Do not check gnupg signatures of revisions.

  • check-available - (default) If gnupg signatures for revisions are present, check them. Bazaar-NG will fail if it finds a bad signature, but will not fail if no signature is present.

create_signatures

Defines the behaviour of signing revisions. It has three possible values: always, never and when-required.

  • always - Sign every new revision that is committed.

  • when-required - (default) Sign newly committed revisions only when the branch requires signed revisions.

  • never - Refuse to sign newly committed revisions, even if the branch requires signatures.

post_commit

(Advanced setting) This variable takes the name of a python function to run upon a successful commit. This variable is only useful if you have already included a plugin that comes with a function that you'd like to run each time commit is successful (for example, the email plugin).

Ignored in branch.conf, for security reasons.

recurse

Only useful in locations.conf. Defines whether or not the configuration for this section applies to subdirectories:

  • true - (default) This section applies to subdirectories as well.

  • false - This section only applies to the branch at this directory and not branches .

gpg_signing_command

Which program should be used to sign and check revisions. Defaults to "gpg".

For example:

gpg_signing_command = /usr/bin/gpg

Ignored in branch.conf, for security reasons.

Aliases section

Command aliases allow you to create new 'commands' that are actually existing commands with particular options. Aliases are defined in the [ALIASES] section of bazaar.conf, with the new alias as the name, and the (partial) command as the value.

For example:

[ALIASES]
# Alias for short logs
slog=log --log-format=short
# Force commit to be strict
commit=commit --strict

Aliases cannot be specified in locations.conf or branch.conf

Aliases can be overridden:

  1. By re-specifying the options. Options that take a value can be re-specified as many times as you like, and only the last one will have an effect. In the above example, bzr slog --log-format=long will produce normal logs. Boolean options can be negated by adding or removing the prefix "no-". In the above example, bzr commit --no-strict will behave as though --strict had not been specified. (It evaluates to bzr commit --strict --no-strict, and the second option overrides the first.)

  2. By specifying --no-aliases at the commandline. This option is recommended when writing wrapper scripts for general use.

Environment variables

* BZR_PROGRESS_BAR: sets the default progress bar type. Can be set to 'none' or 'dummy' to disable the progress bar, 'dots' or 'tty' to create the respective type.

* BZR_EDITOR, (configuration item editor in bazaar.conf), VISUAL, EDITOR (in this order): editor to use.

* BZR_EMAIL, (configuration item email in bazaar.conf), EMAIL (in this order): Commiter email.

* BZR_HOME: Home directory (takes precedance over $HOME on unix, and $APPDATA on windows).

* COLUMNS: Width of the terminal (normally auto-detected).

* BZR_PLUGIN_PATH: Path to search plugins for. Defaults to $HOME/.bazaar/plugins.

* BZRPATH: Path to look for external commands. If set, bzr foobar will look for the executable foobar in $BZRPATH as the shell would look for foobar in $PATH.

* BZR_SSH: SSH executable to use. If none is specified, it tries to use your 'ssh' executable, and defaults to paramiko. Must be exactly one of:

  • loopback: SSH "vendor" that connects over a plain TCP socket, not SSH
  • paramiko: python implementation of SSH
  • none: same as paramiko
  • openssh: uses the 'ssh' executable from OpenSSH.
  • ssh: uses the 'ssh' executable from SSH Corporation

* http_proxy: URL of the HTTP proxy to use.

* BZR_PDB: If set, enter python debugger on error.