• 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. Review Bot 4.x
    2. Version 4.x
    3. Version 3.0
    4. Version 2.0
    5. Version 1.0
    6. Module and Class Reference
    7. reviewbot.repositories
  • Home
  • Installation
  • Manually Installing Review Bot
  • Review Bot Docker Images
  • Upgrading Review Bot
  • Configuring Review Bot
  • Review Bot Tools
  • Cargo Tool
  • Checkstyle
  • Clang Static Analyzer
  • Cppcheck
  • Cpplint
  • Doc8
  • FBInfer
  • Flake8
  • Go Fmt
  • Go Tool
  • JSHint
  • PMD
  • Pycodestyle
  • Pydocstyle
  • Pyflakes
  • RuboCop
  • Rust Fmt
  • Secret Scanner
  • ShellCheck
  • Module and Class Reference
  • reviewbot.tools.base
  • reviewbot.tools.base.mixins
  • reviewbot.tools.base.registry
  • reviewbot.tools.base.tool
  • reviewbot.testing.testcases
  • reviewbot.testing.utils
  • reviewbot.tools.testing
  • reviewbot.tools.testing.decorators
  • reviewbot.tools.testing.testcases
  • reviewbot.processing.review
  • reviewbot.utils.api
  • reviewbot.utils.filesystem
  • reviewbot.utils.log
  • reviewbot.utils.process
  • reviewbot.utils.text
  • reviewbot.celery
  • reviewbot.config
  • reviewbot.deprecation
  • reviewbot.errors
  • reviewbot.repositories
  • reviewbot.tasks
  • reviewbot.tools.cargotool
  • reviewbot.tools.checkstyle
  • reviewbot.tools.clang
  • reviewbot.tools.cppcheck
  • reviewbot.tools.cpplint
  • reviewbot.tools.doc8
  • reviewbot.tools.fbinfer
  • reviewbot.tools.flake8
  • reviewbot.tools.gofmt
  • reviewbot.tools.gotool
  • reviewbot.tools.jshint
  • reviewbot.tools.pmd
  • reviewbot.tools.pycodestyle
  • reviewbot.tools.pydocstyle
  • reviewbot.tools.pyflakes
  • reviewbot.tools.rbsecretscanner
  • reviewbot.tools.rubocop
  • reviewbot.tools.rustfmt
  • reviewbot.tools.shellcheck
  • General Index
  • Python Module Index
  • Release Notes
  • reviewbot.repositories¶

    Full access repository management.

    Functions

    fetch_repositories(url[, user, token])

    Fetch repositories from Review Board.

    init_repositories()

    Set up configured repositories.

    reset_repositories()

    Reset the repository state.

    Classes

    BaseRepository(name, clone_path)

    A repository.

    GitRepository(name, clone_path)

    A git repository.

    HgRepository(name, clone_path)

    A Mercurial repository.

    class BaseRepository(name, clone_path)[source]¶

    Bases: object

    A repository.

    clone_path¶

    The clone path of the repository. This may be the path or mirror_path of the repository in the API.

    Type:

    str

    name¶

    The name of the repository.

    Type:

    str

    repo_path¶

    The local path where the clone/checkout is or will be stored.

    Type:

    str

    repo_types = None[source]¶

    A tuple of known repository configuration types this supports.

    New in version 3.0.

    Type:

    tuple of str

    tool_name = None[source]¶

    The Review Board tool name that this supports.

    New in version 3.0.

    Type:

    str

    __init__(name, clone_path)[source]¶

    Initialize the repository.

    Parameters:
    • name (str) – The name of the repository.

    • clone_path (str) – The clone path of the repository.

    • repo_path (str) –

    sync()[source]¶

    Sync the latest state of the repository.

    checkout(commit_id)[source]¶

    Check out the given commit.

    Parameters:

    commit_id (str) – The ID of the commit to check out.

    Returns:

    The name of a directory with the given checkout.

    Return type:

    str

    __eq__(other)[source]¶

    Return whether this repository is equal to another.

    Parameters:

    other (Repository) – The repository to compare to.

    Returns:

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

    Return type:

    bool

    __repr__()[source]¶

    Return a string representation of the repository.

    New in version 3.0.

    Returns:

    A string representation.

    Return type:

    str

    __hash__ = None¶
    class GitRepository(name, clone_path)[source]¶

    Bases: BaseRepository

    A git repository.

    repo_types = ('git',)[source]¶

    A tuple of known repository configuration types this supports.

    New in version 3.0.

    Type:

    tuple of str

    tool_name = 'Git'[source]¶

    The Review Board tool name that this supports.

    New in version 3.0.

    Type:

    str

    sync()[source]¶

    Sync the latest state of the repository.

    checkout(commit_id)[source]¶

    Check out the given commit.

    Parameters:

    commit_id (str) – The ID of the commit to check out.

    Returns:

    The name of a directory with the given checkout.

    Return type:

    str

    __annotations__ = {}¶
    class HgRepository(name, clone_path)[source]¶

    Bases: BaseRepository

    A Mercurial repository.

    repo_types = ('hg', 'mercurial')[source]¶

    A tuple of known repository configuration types this supports.

    New in version 3.0.

    Type:

    tuple of str

    tool_name = 'Mercurial'[source]¶

    The Review Board tool name that this supports.

    New in version 3.0.

    Type:

    str

    sync()[source]¶

    Sync the latest state of the repository.

    checkout(commit_id)[source]¶

    Check out the given commit.

    Parameters:

    commit_id (str) – The ID of the commit to check out.

    Returns:

    The name of a directory with the given checkout.

    Return type:

    str

    __annotations__ = {}¶
    fetch_repositories(url, user=None, token=None)[source]¶

    Fetch repositories from Review Board.

    Parameters:
    • url (str) – The configured url for the connection.

    • user (str) – The configured user for the connection.

    • token (str) – The configured API token for the user.

    init_repositories()[source]¶

    Set up configured repositories.

    This will set up any configured Review Board servers and fetch any repositories specified in the configuration. As part of this, it will validate the configuration and skip any entries that are misconfigured or result in any unexpected errors.

    reset_repositories()[source]¶

    Reset the repository state.

    This is primarily intended for unit tests.

    New in version 3.0.

    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]
    • BaseRepository
      • BaseRepository.clone_path
      • BaseRepository.name
      • BaseRepository.repo_path
      • BaseRepository.repo_types
      • BaseRepository.tool_name
      • BaseRepository.__init__()
      • BaseRepository.sync()
      • BaseRepository.checkout()
      • BaseRepository.__eq__()
      • BaseRepository.__repr__()
      • BaseRepository.__hash__
    • GitRepository
      • GitRepository.repo_types
      • GitRepository.tool_name
      • GitRepository.sync()
      • GitRepository.checkout()
      • GitRepository.__annotations__
    • HgRepository
      • HgRepository.repo_types
      • HgRepository.tool_name
      • HgRepository.sync()
      • HgRepository.checkout()
      • HgRepository.__annotations__
    • fetch_repositories()
    • init_repositories()
    • reset_repositories()