rbtools.commands.setup_repo¶
Implementation of rbt setup-repo.
Classes
|
Configure a repository to point to a Review Board server. |
- class rbtools.commands.setup_repo.SetupRepo(transport_cls=<class 'rbtools.api.transport.sync.SyncTransport'>, stdout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, stderr=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, stdin=<_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>)[source]¶
Bases:
Command
Configure a repository to point to a Review Board server.
Interactively creates the configuration file .reviewboardrc in the current working directory.
The user is prompted for the Review Board server url if it’s not supplied as an option. Upon a successful server connection, an attempt is made to match the local repository to a repository on the Review Board server. If no match is found or if the user declines the match, the user is prompted to choose from other repositories on the Review Board server.
If the client supports it, it attempts to guess the branch name on the server.
- description = 'Configure an existing repository to point to a Review Board server by generating the configuration file .reviewboardrc'[source]¶
A short description of the command, suitable for display in usage text.
- Type:
- args = ''[source]¶
Usage text for what arguments the command takes.
Arguments for the command are anything passed in other than defined options (for example, revisions passed to rbt post).
- Type:
- option_list = [<rbtools.commands.OptionGroup object>, <rbtools.commands.OptionGroup object>, <rbtools.commands.OptionGroup object>][source]¶
Command-line options for this command.
- Type:
list
ofOption
orOptionGroup
- prompt_rb_repository(local_tool_name, server_tool_names, repository_paths, api_root)[source]¶
Interactively prompt to select a matching repository.
The user is prompted to choose a matching repository found on the Review Board server.
- Parameters:
local_tool_name (
unicode
) – The local name of the detected tool.server_tool_names (
unicode
) – A comma-separated list of potentially matching SCMTool names in the Review Board server.repository_paths (
list
orunicode
, optional) – A list of potential paths to match for the repository.api_root (
rbtools.api.resource.RootResource
) – The root resource for the Review Board server.
- Returns:
The selected repository resource.
- Return type: