rbtools.clients.clearcase¶
A client for ClearCase.
Classes
|
A client for ClearCase. |
|
A representation of a ClearCase source code repository. |
A difference between two directories. |
|
Information about an element in a label. |
- class rbtools.clients.clearcase.ClearCaseClient(**kwargs)[source]¶
Bases:
BaseSCMClientA client for ClearCase.
This is a wrapper around the clearcase tool that fetches repository information and generates compatible diffs. This client assumes that cygwin is installed on Windows.
- __firstlineno__ = 423¶
- __init__(**kwargs) None[source]¶
Initialize the client.
- Parameters:
**kwargs (
dict) – Keyword arguments to pass through to the superclass.
- __static_attributes__ = ('_host_properties', '_host_properties_set', 'is_ucm', 'root_path', 'viewname', 'viewtype', 'vobtag')¶
- check_dependencies() None[source]¶
Check whether all dependencies for the client are available.
This will check for cleartool in the path.
Added in version 4.0.
- Raises:
rbtools.clients.errors.SCMClientDependencyError – cleartool could not be found.
- diff(revisions: SCMClientRevisionSpec | None, *, include_files: Sequence[str] | None = None, exclude_patterns: Sequence[str] | None = None, repository_info: ClearCaseRepositoryInfo, **kwargs) SCMClientDiffResult[source]¶
Perform a diff using the given revisions.
- Parameters:
revisions (
dict) – A dictionary of revisions, as returned byparse_revision_spec().include_files (
listofstr, optional) – A list of files to whitelist during the diff generation.exclude_patterns (
listofstr, optional) – A list of shell-style glob patterns to blacklist during diff generation.repository_info (
ClearCaseRepositoryInfo, optional) – The repository info structure.**kwargs (
dict, optional) – Unused keyword arguments.
- Returns:
A dictionary containing the following keys:
diff(bytes):The contents of the diff to upload.
- Return type:
- find_matching_server_repository(repositories: RepositoryListResource) tuple[RepositoryItemResource | None, RepositoryInfoResource | None][source]¶
Find a match for the repository on the server.
- Parameters:
repositories (
rbtools.api.resource.RepositoryListResource) – The fetched repositories.- Returns:
A 2-tuple of:
- Tuple:
0 (
rbtools.api.resource.RepositoryItemResource) – The matching repository.1 (
rbtools.api.resource.RepositoryInfoResource) – The repository info resource.
- Return type:
- get_local_path() str | None[source]¶
Return the local path to the working tree.
- Returns:
The filesystem path of the repository on the client system.
- Return type:
- get_repository_info() RepositoryInfo | None[source]¶
Return repository information for the current working tree.
- Returns:
The repository info structure.
- Return type:
- property host_properties: _HostProperties[source]¶
A dictionary containing host properties.
This will fetch the properties on first access, and cache for future usage.
The contents are the results of cleartool hostinfo -l, with the addition of:
- Keys:
Callers must call
setup()orhas_dependencies()before accessing this.They also must check for
Noneresponses and exceptions.Changed in version 4.0: Made this a lazily-loaded caching property.
- Type:
- Raises:
rbtools.clients.errors.SCMError – There was an error fetching host property information.
- parse_revision_spec(revisions: Sequence[str] | None = None) SCMClientRevisionSpec[source]¶
Parse the given revision spec.
These will be used to generate the diffs to upload to Review Board (or print).
There are many different ways to generate diffs for ClearCase, because there are so many different workflows. This method serves more as a way to validate the passed-in arguments than actually parsing them in the way that other clients do.
- Parameters:
revisions (
listofstr, optional) – A list of revisions as specified by the user.- Returns:
The parsed revision spec.
See
SCMClientRevisionSpecfor the format of this dictionary.This always populates
baseandtip.- Return type:
- Raises:
rbtools.clients.errors.InvalidRevisionSpecError – The given revisions could not be parsed.
rbtools.clients.errors.TooManyRevisionsError – The specified revisions list contained too many revisions.
- requires_diff_tool: bool | Sequence[str] = True[source]¶
Whether this tool requires a command line diff tool.
This may be a boolean or a list.
If a boolean, then this must be
Falseif no command line tool is required, orTrueif any command line tool supported by RBTools is available (in which case the SCMClient is responsible for ensuring compatibility).If a list, then this must be a list of registered diff tool IDs that are compatible.
Added in version 4.0.
- scmclient_id: str = 'clearcase'[source]¶
The unique ID of the client.
Added in version 4.0: This will be required in RBTools 5.0.
- Type:
- server_tool_ids: ClassVar[Sequence[str] | None] = ['clearcase', 'versionvault'][source]¶
A comma-separated list of SCMClient IDs on the server.
This supersedes
server_tool_nameswhen running on a version of Review Board that supports passing tool IDs to the repositories list API.Added in version 5.0.1.
- Type:
- server_tool_names: ClassVar[str | None] = 'ClearCase,VersionVault / ClearCase'[source]¶
A comma-separated list of SCMClient names on the server.
Added in version 3.0.
- Type:
- class rbtools.clients.clearcase.ClearCaseRepositoryInfo(path: str, vobtag: str)[source]¶
Bases:
RepositoryInfoA representation of a ClearCase source code repository.
This version knows how to find a matching repository on the server even if the URLs differ.
- __firstlineno__ = 2538¶
- __static_attributes__ = ('base_path', 'is_legacy', 'path', 'uuid_to_tags', 'vob_tags', 'vob_uuids', 'vobtag')¶
- tool: ClearCaseClient¶
The SCM client.
- Type:
- update_from_remote(repository: RepositoryItemResource, info: RepositoryInfoResource) None[source]¶
Update the info from a remote repository.
- Parameters:
repository (
rbtools.api.resource.RepositoryItemResource) – The repository resource.info (
rbtools.api.resource.RepositoryInfoResource) – The repository info resource.
- class rbtools.clients.clearcase.DirectoryDiff[source]¶
Bases:
TypedDictA difference between two directories.
Added in version 5.0.
- __firstlineno__ = 69¶
- __static_attributes__ = ()¶
- added: ForwardRef('set[tuple[str, str]]', module='rbtools.clients.clearcase', owner=<class 'rbtools.clients.clearcase.DirectoryDiff'>)¶
The added files.
Each entry is a tuple containing the new filename and new OID.
- deleted: ForwardRef('set[tuple[str, str]]', module='rbtools.clients.clearcase', owner=<class 'rbtools.clients.clearcase.DirectoryDiff'>)¶
The deleted files.
Each entry is a tuple containing the old filename and old OID.
- renamed: ForwardRef('set[tuple[str, str, str, str]]', module='rbtools.clients.clearcase', owner=<class 'rbtools.clients.clearcase.DirectoryDiff'>)¶
The renamed files.
Each entry is a tuple containing the old filename, old OID, new filename, and new OID.