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:
unicode
- name¶
The name of the repository.
- Type:
unicode
- repo_path¶
The local path where the clone/checkout is or will be stored.
- Type:
unicode
- repo_types = None[source]¶
A tuple of known repository configuration types this supports.
New in version 3.0.
- Type:
tuple
ofunicode
- tool_name = None[source]¶
The Review Board tool name that this supports.
New in version 3.0.
- Type:
unicode
- __init__(name, clone_path)[source]¶
Initialize the repository.
- Parameters:
name (
unicode
) – The name of the repository.clone_path (
unicode
) – The clone path of the repository.repo_path (
unicode
) –
- checkout(commit_id)[source]¶
Check out the given commit.
- Parameters:
commit_id (
unicode
) – The ID of the commit to check out.- Returns:
The name of a directory with the given checkout.
- Return type:
unicode
- __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:
unicode
- __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
ofunicode
- tool_name = 'Git'[source]¶
The Review Board tool name that this supports.
New in version 3.0.
- Type:
unicode
- checkout(commit_id)[source]¶
Check out the given commit.
- Parameters:
commit_id (
unicode
) – The ID of the commit to check out.- Returns:
The name of a directory with the given checkout.
- Return type:
unicode
- __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
ofunicode
- tool_name = 'Mercurial'[source]¶
The Review Board tool name that this supports.
New in version 3.0.
- Type:
unicode
- checkout(commit_id)[source]¶
Check out the given commit.
- Parameters:
commit_id (
unicode
) – The ID of the commit to check out.- Returns:
The name of a directory with the given checkout.
- Return type:
unicode
- __annotations__ = {}¶
- fetch_repositories(url, user=None, token=None)[source]¶
Fetch repositories from Review Board.
- Parameters:
url (
unicode
) – The configured url for the connection.user (
unicode
) – The configured user for the connection.token (
unicode
) – 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.