rbtools.clients.cvs¶
A client for CVS.
Classes
|
A client for CVS. |
- class rbtools.clients.cvs.CVSClient(config: Optional[Dict[str, Any]] = None, options: Optional[Namespace] = None)[source]¶
Bases:
BaseSCMClient
A client for CVS.
This is a wrapper around the cvs executable that fetches repository information and generates compatible diffs.
- scmclient_id: str = 'cvs'[source]¶
The unique ID of the client.
New in version 4.0: This will be required in RBTools 5.0.
- Type:
- server_tool_names: ClassVar[Optional[str]] = 'CVS'[source]¶
A comma-separated list of SCMClient names on the server.
New in version 3.0.
- Type:
- server_tool_ids: ClassVar[Optional[List[str]]] = ['cvs'][source]¶
A comma-separated list of SCMClient IDs on the server.
This supersedes
server_tool_names
when running on a version of Review Board that supports passing tool IDs to the repositories list API.New in version 5.0.1.
- Type:
- supports_diff_exclude_patterns: bool = True[source]¶
Whether the SCM client supports excluding files from the diff.
- Type:
- supports_patch_revert: bool = True[source]¶
Whether the SCM client supports reverting patches.
- Type:
- check_dependencies() None [source]¶
Check whether all dependencies for the client are available.
This will check for cvs in the path.
New in version 4.0.
- Raises:
rbtools.clients.errors.SCMClientDependencyError – cvs could not be found.
- get_local_path() Optional[str] [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() Optional[RepositoryInfo] [source]¶
Return repository information for the current working tree.
- Returns:
The repository info structure.
- Return type:
- parse_revision_spec(revisions: List[str] = []) SCMClientRevisionSpec [source]¶
Parse the given revision spec.
These will be used to generate the diffs to upload to Review Board (or print). The diff for review will include the changes in (base, tip].
If a single revision is passed in, this will raise an exception, because CVS doesn’t have a repository-wide concept of “revision”, so selecting an individual “revision” doesn’t make sense.
With two revisions, this will treat those revisions as tags and do a diff between those tags.
If zero revisions are passed in, this will return revisions relevant for the current change.
The CVS SCMClient never fills in the
parent_base
key. Users who are using other patch-stack tools who want to use parent diffs with CVS will have to generate their diffs by hand.Because cvs diff uses multiple arguments to define multiple tags, there’s no single-argument/multiple-revision syntax available.
- Parameters:
revisions (
list
ofstr
, optional) – A list of revisions as specified by the user.- Returns:
The parsed revision spec.
See
SCMClientRevisionSpec
for the format of this dictionary.This always populates
base
andtip
.- 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.
- diff(revisions: SCMClientRevisionSpec, *, include_files: List[str] = [], exclude_patterns: List[str] = [], **kwargs) SCMClientDiffResult [source]¶
Perform a diff using the given revisions.
If no revisions are specified, this will return the diff for the modified files in the working directory. If it’s not empty and contains two revisions, this will do a diff between those revisions.
- Parameters:
revisions (
dict
) – A dictionary of revisions, as returned byparse_revision_spec()
.include_files (
list
ofstr
, optional) – A list of files to whitelist during the diff generation.exclude_patterns (
list
ofstr
, optional) – A list of shell-style glob patterns to blacklist during diff generation.**kwargs (
dict
, unused) – Unused keyword arguments.
- Returns:
A dictionary containing keys documented in
SCMClientDiffResult
.This will only populate the
diff
key.- Return type: