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:
BaseCommandAdd 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: ClassVar[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: ClassVar[bool] = True[source]¶
Whether the command needs the API client.
If this is set, the initialization of the command will set
api_clientandapi_root.New in version 3.0.
- Type:
- needs_scm_client: ClassVar[bool] = True[source]¶
Whether the command needs the SCM client.
If this is set, the initialization of the command will set
repository_infoandtool.New in version 3.0.
- Type:
- needs_repository: ClassVar[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_apiandneeds_scm_clienttoTrue.New in version 3.0.
- Type:
- args: ClassVar[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: ClassVar[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:
listofOptionorOptionGroup
- 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.