• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. RBTools 5.x
    2. Version 5.x
    3. Version 4.x
    4. Version 3.x
    5. Version 2.0
    6. Version 1.0
    7. Version 0.7
    8. Version 0.6
    9. Version 0.5
    10. RBTools Python API
    11. Module and Class References
    12. rbtools.config
  • Home
  • Installing RBTools
  • rbt Command
  • Configuration
  • Authenticating to Review Board
  • Repository Configuration
  • Per-User Configuration
  • Team Foundation Server Configuration
  • Commands
  • alias
  • api-get
  • attach
  • clear-cache
  • close
  • diff
  • install
  • land
  • list-repo-types
  • login
  • logout
  • patch
  • post
  • publish
  • review
  • setup-completion
  • setup-repo
  • stamp
  • status
  • status-update
  • RBTools Workflows
  • Using RBTools With Cliosoft SOS
  • Using RBTools with Git
  • Using RBTools with HCL VersionVault and IBM ClearCase
  • Using RBTools With Perforce
  • RBTools Python API
  • Overview of the Python API Client
  • Tutorial
  • Resource-Specific Functionality
  • Module and Class References
  • rbtools
  • rbtools.deprecation
  • rbtools.api
  • rbtools.api.cache
  • rbtools.api.capabilities
  • rbtools.api.client
  • rbtools.api.decode
  • rbtools.api.decorators
  • rbtools.api.errors
  • rbtools.api.factory
  • rbtools.api.request
  • rbtools.api.resource
  • rbtools.api.transport
  • rbtools.api.transport.sync
  • rbtools.api.utils
  • rbtools.clients
  • rbtools.clients.base
  • rbtools.clients.base.patch
  • rbtools.clients.base.registry
  • rbtools.clients.base.repository
  • rbtools.clients.base.scmclient
  • rbtools.clients.errors
  • rbtools.clients.bazaar
  • rbtools.clients.clearcase
  • rbtools.clients.cvs
  • rbtools.clients.git
  • rbtools.clients.mercurial
  • rbtools.clients.perforce
  • rbtools.clients.plastic
  • rbtools.clients.sos
  • rbtools.clients.svn
  • rbtools.clients.tfs
  • rbtools.config
  • rbtools.config.config
  • rbtools.config.loader
  • rbtools.diffs
  • rbtools.diffs.patches
  • rbtools.diffs.patcher
  • rbtools.diffs.tools
  • rbtools.diffs.tools.backends
  • rbtools.diffs.tools.backends.gnu
  • rbtools.diffs.tools.base
  • rbtools.diffs.tools.base.diff_file_result
  • rbtools.diffs.tools.base.diff_tool
  • rbtools.diffs.tools.errors
  • rbtools.diffs.tools.registry
  • rbtools.diffs.writers
  • rbtools.commands
  • rbtools.commands.main
  • rbtools.commands
  • rbtools.commands.base
  • rbtools.commands.base.commands
  • rbtools.commands.base.errors
  • rbtools.commands.base.options
  • rbtools.commands.base.output
  • rbtools.commands.alias
  • rbtools.commands.api_get
  • rbtools.commands.attach
  • rbtools.commands.clearcache
  • rbtools.commands.close
  • rbtools.commands.diff
  • rbtools.commands.info
  • rbtools.commands.install
  • rbtools.commands.land
  • rbtools.commands.list_repo_types
  • rbtools.commands.login
  • rbtools.commands.logout
  • rbtools.commands.patch
  • rbtools.commands.post
  • rbtools.commands.publish
  • rbtools.commands.review
  • rbtools.commands.setup_completion
  • rbtools.commands.setup_repo
  • rbtools.commands.stamp
  • rbtools.commands.status
  • rbtools.commands.status_update
  • rbtools.hooks
  • rbtools.hooks.common
  • rbtools.hooks.git
  • rbtools.testing
  • rbtools.testing.api
  • rbtools.testing.api.payloads
  • rbtools.testing.api.transport
  • rbtools.testing.commands
  • rbtools.testing.testcase
  • rbtools.testing.transport
  • rbtools.utils
  • rbtools.utils.aliases
  • rbtools.utils.browser
  • rbtools.utils.checks
  • rbtools.utils.commands
  • rbtools.utils.console
  • rbtools.utils.diffs
  • rbtools.utils.encoding
  • rbtools.utils.errors
  • rbtools.utils.filesystem
  • rbtools.utils.graphs
  • rbtools.utils.mimetypes
  • rbtools.utils.process
  • rbtools.utils.repository
  • rbtools.utils.review_request
  • rbtools.utils.source_tree
  • rbtools.utils.users
  • Glossary
  • General Index
  • Python Module Index
  • Release Notes
  • rbtools.config¶

    Configuration management for RBTools.

    This provides convenience imports for the following:

    RBToolsConfig(*[, config_dict, filename])

    Configuration for a .reviewboardrc file.

    get_config_paths()

    Return the paths to each .reviewboardrc influencing the cwd.

    load_config()

    Load configuration from .reviewboardrc files.

    parse_config_file(filename)

    Parse a .reviewboardrc file.

    New in version 5.0.

    class rbtools.config.ConfigData(*, config_dict: Optional[Dict[str, Any]] = None, filename: Optional[str] = None)¶

    Bases: object

    Wrapper for configuration data.

    This stores raw configuration data, providing both dictionary-like and attribute-like access to it, as well as allowing subclasses to wrap dictionaries in another ConfigData instance.

    Subclasses are expected to add type annotations for every known field that should be accessed through the class.

    __init__(*, config_dict: Optional[Dict[str, Any]] = None, filename: Optional[str] = None) → None¶

    Initialize the configuration data wrapper.

    Parameters:
    • config_dict (dict, optional) – Loaded configuration data to wrap.

    • filename (str, optional) – The name of the associated configuration file.

    filename: Optional[str]¶

    The filename that stored this configuration, if any.

    copy() → Self¶

    Return a copy of this configuration data.

    Returns:

    A copy of this instance’s class with a copy of the data.

    Return type:

    ConfigData

    get(key: str, default: Any = None) → Any¶

    Return a value from a configuration item.

    This will return the value from the loaded configuration data, falling back to class-specified default value or the provided default value.

    This helps emulate dictionary-based access.

    Parameters:
    • key (str) – The configuration key.

    • default (object, optional) – The default value if the key cannot be found.

    Returns:

    The configuration value, or a default value if the key was not found.

    Return type:

    object

    merge(other_config: ConfigData) → None¶

    Merge other configuration into this one.

    Any ConfigData or dictionary values will be merged recursively.

    Parameters:

    other_config (ConfigData) – The configuration data to merge in.

    __eq__(other: Any) → bool¶

    Return whether this configuration is equal to another.

    Configurations are equal if they are of the same type and have the same stored settings.

    The filename is not factored in.

    Parameters:

    other (object) – The other object to compare to.

    Returns:

    True if the two objects are equal. False if they are not.

    Return type:

    bool

    __delitem__(name: str) → None¶

    Remove a key from the configuration.

    Parameters:

    name (str) – The name of the key to remove.

    __contains__(key: str) → bool¶

    Return whether a key is found in the configuration.

    A key will be considered found if it either has a default value or is present in the loaded configuration data.

    Parameters:

    key (str) – The key to look for.

    Returns:

    True if the key was found. False if it was not.

    Return type:

    bool

    __getattribute__(name: str) → Any¶

    Return the value for a configuration key as an attribute.

    This will return the value from the loaded configuration data, falling back to class-specified default value if one exists.

    Parameters:

    name (str) – The configuration key.

    Returns:

    The configuration value, if found or if it has a default.

    Return type:

    object

    Raises:

    AttributeError – The configuration key or default was not found.

    __getitem__(name: str) → Any¶

    Return the value for a configuration key as a dictionary key.

    This will return the value from the loaded configuration data, falling back to class-specified default value if one exists.

    Parameters:

    name (str) – The configuration key.

    Returns:

    The configuration value, if found or if it has a default.

    Return type:

    object

    Raises:

    KeyError – The configuration key or default was not found.

    __set_name__(owner: type[object], name: str) → None¶

    Handle an assignment of this instance to a class.

    If setting this on another ConfigData, this will be registered in the owner class’s list of wrappers.

    Parameters:
    • owner (type) – The class this is being set on.

    • name (str) – The attribute name being used for the assignment.

    __repr__() → str¶

    Return a string representation of the configuration data.

    Returns:

    The string representation.

    Return type:

    str

    __hash__ = None¶
    class rbtools.config.RBToolsConfig(*, config_dict: Optional[Dict[str, Any]] = None, filename: Optional[str] = None)¶

    Bases: ConfigData

    Configuration for a .reviewboardrc file.

    New in version 5.0.

    wrappers = {'COLOR': <class 'rbtools.config.config.ColorsConfig'>}¶
    DEBUG: bool = False¶

    Whether debug output is enabled.

    JSON_OUTPUT: bool = False¶

    Whether JSON output is enabled.

    New in version 3.0.

    ALIASES: dict[str, str] = {}¶

    A mapping of RBTools aliases to commands.

    New in version 1.0.

    COLOR: ColorsConfig = <RBToolsConfig(filename=None, config={})>¶

    Colors used for log/text output.

    New in version 1.0.

    OPEN_BROWSER: bool = False¶

    Whether to automatically open a browser for any URLs.

    TREES: dict[str, Any] = {}¶

    A mapping of paths to directory- or repository-specific configuration.

    This allows the creation of a single .reviewboardrc file which can contain separate configurations for multiple repositories. The keys for this can be the repository path (remote) or the local directories. The values are dictionaries which can contain any valid .reviewboardrc config keys.

    This existed in older versions (4 and below) but was limited to just the REVIEWBOARD_URL setting.

    New in version 5.1.

    REVIEWBOARD_URL: Optional[str] = None¶

    The URL for the Review Board server.

    API_TOKEN: Optional[str] = None¶

    An API token to use for authentication.

    This takes place over a password.

    New in version 0.7.

    USERNAME: Optional[str] = None¶

    A username to use for authentication.

    PASSWORD: Optional[str] = None¶

    A password to use for authentication.

    SAVE_COOKIES: bool = True¶

    Whether to save new cookies to disk.

    New in version 0.7.3.

    EXT_AUTH_COOKIES: Optional[str] = None¶

    The path to an external cookies file with pre-fetched cookies.

    This is useful with servers that require extra web authentication to access the Review Board server itself, such as certain Single Sign-On services or proxies.

    New in version 0.7.5.

    COOKIES_STRICT_DOMAIN_MATCH: bool = False¶

    Whether to enable strict domain matching for cookies.

    By default, cookies that match both a domain and a parent domain (e.g., subdomain.example.com and example.com) will both be sent in requests.

    Strict domains can be enabled if there’s a risk of conflict between cookies on a domain and a parent domain.

    This is off by default for backwards-compatibility.

    New in version 5.1.

    WEB_LOGIN: bool = False¶

    Whether to default to using web-based login for authentication.

    If this is set, web-based login will be used instead of prompting for authentication credentials in the terminal.

    New in version 5.0.

    ENABLE_PROXY: bool = False¶

    Whether to allow usage of a configured HTTP(S) proxy server.

    PROXY_AUTHORIZATION: Optional[str] = None¶

    A value to send in Proxy-Authorization headers for HTTP requests.

    This can be used to authenticate with proxy services.

    CACHE_LOCATION: Optional[str] = None¶

    The file to use for the API cache database.

    If not explicitly provided, a default will be chosen.

    New in version 0.7.3.

    DISABLE_CACHE: bool = False¶

    Whether to disable HTTP caching completely.

    This will result in slower requests.

    New in version 0.7.3.

    IN_MEMORY_CACHE: bool = False¶

    Whether to use an in-memory cache, instead of writing to disk.

    New in version 0.7.3.

    CA_CERTS: Optional[str] = None¶

    A path to an additional SSL/TLS CA bundle.

    CLIENT_CERT: Optional[str] = None¶

    A path to a SSL/TLS certificate for communicating with the server.

    CLIENT_KEY: Optional[str] = None¶

    A path to a SSL/TLS key for communicating with the server.

    DISABLE_SSL_VERIFICATION: bool = False¶

    Whether to disable SSL/TLS verification.

    REPOSITORY: Optional[str] = None¶

    The name of the repository on Review Board to communicate with.

    Changed in version 0.6: This previously supported taking a configured repository URL. That now must be provided in REPOSITORY_URL.

    REPOSITORY_TYPE: Optional[str] = None¶

    The type of the repository on Review Board.

    This must be a value found in rbt list-repo-types.

    REPOSITORY_URL: Optional[str] = None¶

    The URL to the repository.

    This can be used to override the detected URL for some SCMs or to influence certain operations.

    For Subversion, this can be used to generate a diff outside of a working copy.

    For Git, this can override the origin URL.

    Changed in version 0.6: This previously supported taking a configured repository name. That now must be provided in REPOSITORY.

    BASEDIR: Optional[str] = None¶

    The path within the repository where the diff is generated.

    This will be prepended to any relative URLs in the path. Specifying this overrides any detected paths.

    It’s currently only supported for Subversion, usually when using --diff-filename options.

    EXCLUDE_PATTERNS: list[str] = []¶

    A list of file patterns to exclude from the diff.

    New in version 0.7.

    PARENT_BRANCH: Optional[str] = None¶

    The parent branch the generate diffs relative to.

    This is only supported by some SCMs. In general, this should not be used. Instead, revision ranges should be provided.

    TRACKING_BRANCH: Optional[str] = None¶

    The remote tracking branch that the local branch corresponds to.

    This is used for Git and Mercurial, and will override any automatic tracking branch detection implemented by the SCM client.

    BRANCH: Optional[str] = None¶

    The value of the Branch field on a review request.

    This will update the field when posting a change for review using :rbt-command:`post`.

    Other commands may use it to inspect client-side defaults, but it’s recommended to inspect the review request where possible.

    DEPENDS_ON: Optional[str] = None¶

    A comma-separated list of review request IDs to depend on.

    This will update the field when posting a change for review using :rbt-command:`post`.

    Other commands may use it to inspect client-side defaults, but it’s recommended to inspect the review request where possible.

    New in version 0.6.1.

    MARKDOWN: bool = False¶

    Whether to enable Markdown for any text content.

    If set, review request, review, and comment text content will be uploaded in Markdown format.

    New in version 0.6.

    TARGET_GROUPS: Optional[str] = None¶

    A comma-separated list of group names to list as reviewers.

    This will update the field when posting a change for review using :rbt-command:`post`.

    Other commands may use it to inspect client-side defaults, but it’s recommended to inspect the review request where possible.

    TARGET_PEOPLE: Optional[str] = None¶

    A comma-separated list of usernames to list as reviewers.

    This will update the field when posting a change for review using :rbt-command:`post`.

    Other commands may use it to inspect client-side defaults, but it’s recommended to inspect the review request where possible.

    P4_CLIENT: Optional[str] = None¶

    The Perforce client name for the repository.

    P4_PORT: Optional[str] = None¶

    The IP address/port for the Perforce server.

    P4_PASSWD: Optional[str] = None¶

    The password or ticket of the user in Perforce.

    SVN_PROMPT_PASSWORD: bool = False¶

    Whether to prompt for a user’s Subversion password.

    New in version 0.7.3.

    TF_CMD: Optional[str] = None¶

    The full path to the tf command.

    This will override any detected path.

    New in version 0.7.6.

    LAND_DELETE_BRANCH: bool = True¶

    Whether to delete the local branch when landed.

    This is only used when deleting local branches.

    New in version 0.7.

    LAND_DEST_BRANCH: Optional[str] = None¶

    The name of a destination branch that changes should land on.

    This is required when landing.

    New in version 0.7.

    LAND_PUSH: bool = False¶

    Whether to push the destination branch after landing the change.

    New in version 0.7.

    LAND_SQUASH: bool = False¶

    Whether to squash multiple commits into one when landing.

    New in version 0.7.

    GUESS_FIELDS: Optional[str] = 'auto'¶

    Whether to guess and set review request fields from a commit.

    This will control the values for the following settings:

    • GUESS_DESCRIPTION

    • GUESS_SUMMARY

    GUESS_DESCRIPTION: Optional[GuessFlag] = None¶

    Whether to guess and set a review request description from a commit.

    GUESS_SUMMARY: Optional[GuessFlag] = None¶

    Whether to guess and set a review request summary from a commit.

    PUBLISH: bool = False¶

    Whether to publish a change immediately after posting it.

    To succeed, all required fields must already be filled in on the review request.

    SQUASH_HISTORY: bool = False¶

    Whether to create the review request in legacy single-commit mode.

    If set, the review request will not be able to display multi-commit reviews.

    This should be considered a legacy setting.

    New in version 2.0.

    STAMP_WHEN_POSTING: bool = False¶

    Whether to stamp the commit message with the review request URL.

    This is used by :rbt-command:`post` to perform the stamping once posted.

    New in version 0.7.3.

    SUBMIT_AS: Optional[str] = None¶

    A username to use as the author of the review request.

    This requires the logged-in user to have the special reviews.can_submit_as permission. See Automating rbt post.

    API_GET_PRETTY_PRINT: bool = False¶

    Whether to pretty-print the resulting API payload.

    New in version 0.5.2.

    rbtools.config.get_config_paths() → list[str]¶

    Return the paths to each .reviewboardrc influencing the cwd.

    A list of paths to .reviewboardrc files will be returned, where each subsequent list entry should have lower precedence than the previous. i.e. configuration found in files further up the list will take precedence.

    Configuration in the paths set in $RBTOOLS_CONFIG_PATH will take precedence over files found in the current working directory or its parents.

    Returns:

    The list of configuration paths.

    Return type:

    list of str

    rbtools.config.load_config() → RBToolsConfig¶

    Load configuration from .reviewboardrc files.

    This will read all of the .reviewboardrc files influencing the cwd and return a dictionary containing the configuration.

    Returns:

    The loaded configuration data.

    Return type:

    dict

    rbtools.config.parse_config_file(filename: str) → RBToolsConfig¶

    Parse a .reviewboardrc file.

    Returns a dictionary containing the configuration from the file.

    Parameters:

    filename (str) – The full path to a .reviewboardrc file.

    Returns:

    The loaded configuration data.

    Return type:

    dict

    Raises:

    rbtools.config.errors.ConfigSyntaxError – There was a syntax error in the configuration file.

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2025 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]
    • ConfigData
      • ConfigData.__init__()
      • ConfigData.filename
      • ConfigData.copy()
      • ConfigData.get()
      • ConfigData.merge()
      • ConfigData.__eq__()
      • ConfigData.__delitem__()
      • ConfigData.__contains__()
      • ConfigData.__getattribute__()
      • ConfigData.__getitem__()
      • ConfigData.__set_name__()
      • ConfigData.__repr__()
      • ConfigData.__hash__
    • RBToolsConfig
      • RBToolsConfig.wrappers
      • RBToolsConfig.DEBUG
      • RBToolsConfig.JSON_OUTPUT
      • RBToolsConfig.ALIASES
      • RBToolsConfig.COLOR
      • RBToolsConfig.OPEN_BROWSER
      • RBToolsConfig.TREES
      • RBToolsConfig.REVIEWBOARD_URL
      • RBToolsConfig.API_TOKEN
      • RBToolsConfig.USERNAME
      • RBToolsConfig.PASSWORD
      • RBToolsConfig.SAVE_COOKIES
      • RBToolsConfig.EXT_AUTH_COOKIES
      • RBToolsConfig.COOKIES_STRICT_DOMAIN_MATCH
      • RBToolsConfig.WEB_LOGIN
      • RBToolsConfig.ENABLE_PROXY
      • RBToolsConfig.PROXY_AUTHORIZATION
      • RBToolsConfig.CACHE_LOCATION
      • RBToolsConfig.DISABLE_CACHE
      • RBToolsConfig.IN_MEMORY_CACHE
      • RBToolsConfig.CA_CERTS
      • RBToolsConfig.CLIENT_CERT
      • RBToolsConfig.CLIENT_KEY
      • RBToolsConfig.DISABLE_SSL_VERIFICATION
      • RBToolsConfig.REPOSITORY
      • RBToolsConfig.REPOSITORY_TYPE
      • RBToolsConfig.REPOSITORY_URL
      • RBToolsConfig.BASEDIR
      • RBToolsConfig.EXCLUDE_PATTERNS
      • RBToolsConfig.PARENT_BRANCH
      • RBToolsConfig.TRACKING_BRANCH
      • RBToolsConfig.BRANCH
      • RBToolsConfig.DEPENDS_ON
      • RBToolsConfig.MARKDOWN
      • RBToolsConfig.TARGET_GROUPS
      • RBToolsConfig.TARGET_PEOPLE
      • RBToolsConfig.P4_CLIENT
      • RBToolsConfig.P4_PORT
      • RBToolsConfig.P4_PASSWD
      • RBToolsConfig.SVN_PROMPT_PASSWORD
      • RBToolsConfig.TF_CMD
      • RBToolsConfig.LAND_DELETE_BRANCH
      • RBToolsConfig.LAND_DEST_BRANCH
      • RBToolsConfig.LAND_PUSH
      • RBToolsConfig.LAND_SQUASH
      • RBToolsConfig.GUESS_FIELDS
      • RBToolsConfig.GUESS_DESCRIPTION
      • RBToolsConfig.GUESS_SUMMARY
      • RBToolsConfig.PUBLISH
      • RBToolsConfig.SQUASH_HISTORY
      • RBToolsConfig.STAMP_WHEN_POSTING
      • RBToolsConfig.SUBMIT_AS
      • RBToolsConfig.API_GET_PRETTY_PRINT
    • get_config_paths()
    • load_config()
    • parse_config_file()