Jump to >

rbtools.clients

Support for interfacing with source code management systems.

This provides support for creating, looking up, and registering SCM client integrations, enabling RBTools to interact with local source code repositories and communicate on their behalf to Review Board.

This particular module provides forwarding imports for:

PatchAuthor

The author of a patch or commit.

PatchResult

The result of a patch operation.

scmclient_registry

The main SCMClients registry used by RBTools.

RepositoryInfo

A representation of a source code repository.

BaseSCMClient

A base class for interfacing with a source code management tool.

As well as some (soon to be legacy) utility functions and classes.

Changed in version 4.0:

Functions

load_scmclients(config, options)

Load the available SCM clients.

scan_usable_client(config, options[, ...])

Scan for a usable SCMClient.

Classes

SCMClient(*args, **kwargs)

A base representation of an SCM tool.

class rbtools.clients.SCMClient(*args, **kwargs)[source]

Bases: BaseSCMClient

A base representation of an SCM tool.

Deprecated since version 4.0: This has been moved to rbtools.clients.base.scmclient.BaseSCMClient. Callers should updated to inherit from this.

This legacy class will be removed in RBTools 5.0.

__init__(*args, **kwargs)[source]

Initialize the client.

Parameters:
  • *args (tuple) – Positional arguments to pass to the parent class.

  • **kwargs (tuple) – Keyword arguments to pass to the parent class.

rbtools.clients.load_scmclients(config, options)[source]

Load the available SCM clients.

Parameters:
  • config (dict) – The loaded user config.

  • options (argparse.Namespace) – The parsed command line arguments.

rbtools.clients.scan_usable_client(config, options, client_name=None)[source]

Scan for a usable SCMClient.

Parameters:
  • config (dict) – The loaded user config.

  • options (argparse.Namespace) – The parsed command line arguments.

  • client_name (unicode, optional) – A specific client name, which can come from the configuration. This can be used to disambiguate if there are nested repositories, or to speed up detection.

Returns:

A 2-tuple, containing the repository info structure and the tool instance.

Return type:

tuple