• 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 4.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.clients.bazaar
  • 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.diffs
  • 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.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.checks
  • rbtools.utils.commands
  • rbtools.utils.console
  • rbtools.utils.diffs
  • rbtools.utils.encoding
  • rbtools.utils.errors
  • rbtools.utils.filesystem
  • rbtools.utils.graphs
  • rbtools.utils.match_score
  • rbtools.utils.process
  • rbtools.utils.repository
  • rbtools.utils.review_request
  • rbtools.utils.source_tree
  • rbtools.utils.testbase
  • rbtools.utils.users
  • Glossary
  • General Index
  • Python Module Index
  • Release Notes
  • This documentation covers RBTools 4.x. You can select a version above or view the latest documentation.

    rbtools.clients.bazaar¶

    A client for Bazaar and Breezy.

    Classes

    BazaarClient(**kwargs)

    A client for Bazaar and Breezy.

    class rbtools.clients.bazaar.BazaarClient(**kwargs)[source]¶

    Bases: BaseSCMClient

    A client for Bazaar and Breezy.

    This is a wrapper that fetches repository information and generates compatible diffs.

    It supports the legacy Bazaar client, as well as the modern Breezy.

    Changed in version 2.0.1: Added support for Breezy.

    scmclient_id: str = 'bazaar'[source]¶

    The unique ID of the client.

    New in version 4.0: This will be required in RBTools 5.0.

    Type:

    str

    name: str = 'Bazaar'[source]¶

    The name of the client.

    Type:

    str

    server_tool_names: Optional[str] = 'Bazaar'[source]¶

    A comma-separated list of SCMClient names on the server

    New in version 3.0.

    Type:

    str

    supports_diff_exclude_patterns: bool = True[source]¶

    Whether the SCM client supports excluding files from the diff.

    Type:

    bool

    supports_parent_diffs: bool = True[source]¶

    Whether the SCM client supports generating parent diffs.

    New in version 3.0.

    Type:

    bool

    can_branch: bool = True[source]¶

    Whether new branches can be created.

    Type:

    bool

    INDEX_FILE_RE = re.compile(b"===.+'(.+?)'\n")[source]¶
    BRANCH_REGEX = '\\w*(repository branch|branch root|checkout root|checkout of branch): (?P<branch_path>.+)$'[source]¶
    REVISION_SEPARATOR_REGEX = re.compile('\\.\\.(?![\\\\/])')[source]¶
    __init__(**kwargs) → None[source]¶

    Initialize the client.

    Parameters:

    **kwargs (dict) – Keyword arguments to pass through to the base class.

    property bzr: str[source]¶

    The name of the command line tool for Breezy or Bazaar.

    Callers must call setup() or has_dependencies() before accessing this. This will be required starting in RBTools 5.0.

    This will fall back to “bzr” if neither Bazaar nor Breezy is installed.

    Type:

    str

    property is_breezy: bool[source]¶

    Whether the client will be working with Breezy, instead of Bazaar.

    Callers must call setup() or has_dependencies() before accessing this. This will be required starting in RBTools 5.0.

    Type:

    bool

    check_dependencies() → None[source]¶

    Check whether the base dependencies needed are available.

    This will check for both brz (Breezy) or bzr (which may be Bazaar or a Breezy symlink).

    New in version 4.0.

    Raises:

    rbtools.clients.errors.SCMClientDependencyError – Neither bzr nor brz could be found.

    get_local_path() → Optional[str][source]¶

    Return the local path to the working tree.

    Returns:

    The filesystem path of the repository on the client system.

    Return type:

    str

    get_repository_info() → Optional[RepositoryInfo][source]¶

    Return repository information for the current working tree.

    Returns:

    The repository info structure.

    Return type:

    rbtools.clients.base.repository.RepositoryInfo

    parse_revision_spec(revisions: List[str] = []) → SCMClientRevisionSpec[source]¶

    Parse the given revision spec.

    These will be used to generate the diffs to upload to Review Board (or print). The diff for review will include the changes in (base, tip], and the parent diff (if necessary) will include (parent, base].

    If a single revision is passed in, this will return the parent of that revision for “base” and the passed-in revision for “tip”.

    If zero revisions are passed in, this will return the current HEAD as ‘tip’, and the upstream branch as ‘base’, taking into account parent branches explicitly specified via --parent.

    Parameters:

    revisions (list of str, optional) – A list of revisions as specified by the user.

    Returns:

    The parsed revision spec.

    See SCMClientRevisionSpec for the format of this dictionary.

    This always populates base and tip.

    parent_base will be populated if using --parent.

    Return type:

    dict

    Raises:
    • rbtools.clients.errors.InvalidRevisionSpecError – The given revisions could not be parsed.

    • rbtools.clients.errors.TooManyRevisionsError – The specified revisions list contained too many revisions.

    diff(revisions: SCMClientRevisionSpec, *, include_files: List[str] = [], exclude_patterns: List[str] = [], **kwargs) → SCMClientDiffResult[source]¶

    Perform a diff using the given revisions.

    If the revision spec is empty, this returns the diff of the current branch with respect to its parent. If a single revision is passed in, this returns the diff of the change introduced in that revision. If two revisions are passed in, this will do a diff between those two revisions.

    Parameters:
    • revisions (dict) – A dictionary of revisions, as returned by parse_revision_spec().

    • include_files (list of str, optional) – A list of files to whitelist during the diff generation.

    • exclude_patterns (list of str, optional) – A list of shell-style glob patterns to blacklist during diff generation.

    • extra_args (list, unused) – Additional arguments to be passed to the diff generation. Unused for Bazaar.

    • **kwargs (dict, unused) – Unused keyword arguments.

    Returns:

    A dictionary containing keys documented in SCMClientDiffResult.

    This will only populate the diff key.

    Return type:

    dict

    get_raw_commit_message(revisions: SCMClientRevisionSpec) → str[source]¶

    Extract the commit message based on the provided revision range.

    Parameters:

    revisions (dict) – A dictionary containing base and tip keys.

    Returns:

    The commit messages of all commits between (base, tip].

    Return type:

    str

    get_current_branch() → str[source]¶

    Return the name of the current branch.

    Returns:

    A string with the name of the current branch.

    Return type:

    str

    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]