rbtools.utils.repository¶
Utility functions for working with repositories.
Functions
|
Return the ID of a repostiory from the server. |
|
Return the API resource for the matching repository on the server. |
- rbtools.utils.repository.get_repository_resource(api_root, tool=None, repository_name=None, repository_paths=None)[source]¶
Return the API resource for the matching repository on the server.
New in version 3.0.
- Parameters:
api_root (
rbtools.api.resource.RootResource
) – The root resource for the API.tool (
rbtools.clients.base.BaseSCMClient
, optional) – The SCM client corresponding to the local working directory.repository_name (
unicode
, optional) – An explicit repository name provided by the local configuration.repository_paths (
list
orunicode
, optional) – A list of potential paths to match for the repository.
- Returns:
A 2-tuple of
ItemResource
. The first item is the matching repository, and the second is the repository info resource.- Return type:
- rbtools.utils.repository.get_repository_id(repository_info, api_root, repository_name=None)[source]¶
Return the ID of a repostiory from the server.
This will look up all accessible repositories on the server and try to find the ID of one that matches the provided repository information.
- Parameters:
repository_info (
rbtools.clients.base.repository.RepositoryInfo
) – The scanned repository information.api_root (
rbtools.api.resource.RootResource
) – The root resource for the API.repository_name (
unicode
, optional) – An explicit repository name provided by local configuration.
- Returns:
The ID of the repository, or
None
if not found.- Return type: