reviewbot.repositories¶
Full access repository management.
Functions
|
Fetch repositories from Review Board. |
Set up configured repositories. |
|
Reset the repository state. |
Classes
|
A repository. |
|
A git repository. |
|
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
ormirror_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
ofstr
- 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
) –
- 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
ofstr
- tool_name = 'Git'[source]¶
The Review Board tool name that this supports.
New in version 3.0.
- Type:
str
- 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
ofstr
- tool_name = 'Mercurial'[source]¶
The Review Board tool name that this supports.
New in version 3.0.
- Type:
str
- 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.