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: type[Transport] = <class 'rbtools.api.transport.sync.SyncTransport'>, stdout: TextIO = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, stderr: TextIO = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, stdin: TextIO = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>)[source]¶
Bases:
BaseCommand
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: ClassVar[str] = '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: ClassVar[str] = ''[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: ClassVar[list[Union[Option, OptionGroup]]] = [<rbtools.commands.base.options.OptionGroup object>, <rbtools.commands.base.options.OptionGroup object>, <rbtools.commands.base.options.OptionGroup object>][source]¶
Command-line options for this command.
- Type:
list
ofOption
orOptionGroup
- prompt_rb_repository(local_tool_name: str, server_tool_names: Optional[str], repository_paths: Optional[Union[str, list[str]]], api_root: RootResource) Optional[ItemResource] [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 (
str
) – The local name of the detected tool.server_tool_names (
str
) – A comma-separated list of potentially matching SCMTool names in the Review Board server.repository_paths (
list
orstr
, 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: