rbtools.commands.stamp¶
Implementation of rbt stamp.
Classes
|
Add the review request URL to the commit message. |
- class rbtools.commands.stamp.Stamp(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
Add the review request URL to the commit message.
Stamps the review request URL onto the commit message of the revision specified. The revisions argument behaves like it does in rbt post, where it is required for some SCMs (e.g. Perforce) and unnecessary/ignored for others (e.g. Git).
Normally, this command will guess the review request (based on the revision number if provided, and the commit summary and description otherwise). However, if a review request ID is specified by the user, it stamps the URL of that review request instead of guessing.
- description: str = 'Adds the review request URL to the commit message.'[source]¶
A short description of the command, suitable for display in usage text.
- Type:
- needs_api: bool = True[source]¶
Whether the command needs the API client.
If this is set, the initialization of the command will set
api_client
andapi_root
.New in version 3.0.
- Type:
- needs_scm_client: bool = True[source]¶
Whether the command needs the SCM client.
If this is set, the initialization of the command will set
repository_info
andtool
.New in version 3.0.
- Type:
- needs_repository: bool = True[source]¶
Whether the command needs the remote repository object.
If this is set, the initialization of the command will set
repository
.Setting this will imply setting both
needs_api
andneeds_scm_client
toTrue
.New in version 3.0.
- Type:
- args: str = '[revisions]'[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: List[Union[Option, OptionGroup]] = [<rbtools.commands.base.options.OptionGroup object>, <rbtools.commands.base.options.OptionGroup object>, <rbtools.commands.base.options.OptionGroup object>, <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
- determine_review_request(revisions: SCMClientRevisionSpec) tuple[Optional[int], Optional[str]] [source]¶
Determine the correct review request for a commit.
- Parameters:
revisions (
rbtools.clients.base.scmclient.SCMClientRevisionSpec
) – The parsed revisions from the command line.- Returns:
A 2-tuple containing:
- Return type:
- Raises:
rbtools.commands.CommandError – An error occurred while attempting to find a matching review request.