• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. RBTools 6.x
    2. Version 6.x
    3. Version 5.x
    4. Version 4.x
    5. Version 3.x
    6. Version 2.0
    7. Version 1.0
    8. Version 0.7
    9. Version 0.6
    10. Version 0.5
    11. RBTools Python API
    12. Module and Class References
    13. rbtools.clients.clearcase
  • Home
  • Installing RBTools
  • Authenticating to Review Board
  • rbt Command
  • Configuration
  • Creating Custom Command Aliases
  • Repository Configuration
  • Per-User Configuration
  • Azure DevOps / Team Foundation Server Configuration
  • Commands
  • alias
  • api-get
  • attach
  • clear-cache
  • close
  • diff
  • info
  • install
  • land
  • list-repo-types
  • login
  • logout
  • patch
  • post
  • publish
  • review
  • setup-completion
  • setup-repo
  • stamp
  • status
  • status-update
  • RBTools Workflows
  • Using RBTools with Git
  • Using RBTools With Perforce
  • Using RBTools with Jujutsu
  • Using RBTools with HCL ClearCase and IBM ClearCase
  • Using RBTools With Keysight SOS
  • RBTools Python API
  • Overview of the Python API Client
  • Common Use Cases
  • Module and Class References
  • rbtools
  • rbtools.deprecation
  • rbtools.api
  • rbtools.api.cache
  • rbtools.api.capabilities
  • rbtools.api.client
  • rbtools.api.decode
  • rbtools.api.decorators
  • rbtools.api.errors
  • rbtools.api.factory
  • rbtools.api.request
  • rbtools.api.transport
  • rbtools.api.transport.sync
  • rbtools.api.utils
  • rbtools.api.resource
  • rbtools.api.resource.base
  • rbtools.api.resource.base_archived_object
  • rbtools.api.resource.base_comment
  • rbtools.api.resource.base_diff_commit
  • rbtools.api.resource.base_review_group
  • rbtools.api.resource.base_review_request
  • rbtools.api.resource.base_review
  • rbtools.api.resource.base_user
  • rbtools.api.resource.mixins
  • rbtools.api.resource.api_token
  • rbtools.api.resource.archived_review_request
  • rbtools.api.resource.change
  • rbtools.api.resource.default_reviewer
  • rbtools.api.resource.diff_comment
  • rbtools.api.resource.diff_commit
  • rbtools.api.resource.diff_context
  • rbtools.api.resource.diff_file_attachment
  • rbtools.api.resource.diff
  • rbtools.api.resource.draft_diff_commit
  • rbtools.api.resource.draft_file_attachment
  • rbtools.api.resource.draft_screenshot
  • rbtools.api.resource.extension
  • rbtools.api.resource.file_attachment_comment
  • rbtools.api.resource.file_attachment
  • rbtools.api.resource.file_diff
  • rbtools.api.resource.general_comment
  • rbtools.api.resource.hosting_service_account
  • rbtools.api.resource.hosting_service
  • rbtools.api.resource.last_update
  • rbtools.api.resource.muted_review_request
  • rbtools.api.resource.oauth_application
  • rbtools.api.resource.oauth_token
  • rbtools.api.resource.plain_text
  • rbtools.api.resource.remote_repository
  • rbtools.api.resource.repository_branch
  • rbtools.api.resource.repository_commit
  • rbtools.api.resource.repository_group
  • rbtools.api.resource.repository_info
  • rbtools.api.resource.repository_user
  • rbtools.api.resource.repository
  • rbtools.api.resource.review_group_user
  • rbtools.api.resource.review_group
  • rbtools.api.resource.review_reply
  • rbtools.api.resource.review_request_draft
  • rbtools.api.resource.review_request
  • rbtools.api.resource.review
  • rbtools.api.resource.root
  • rbtools.api.resource.screenshot_comment
  • rbtools.api.resource.screenshot
  • rbtools.api.resource.search
  • rbtools.api.resource.server_info
  • rbtools.api.resource.session
  • rbtools.api.resource.status_update
  • rbtools.api.resource.user_file_attachment
  • rbtools.api.resource.user
  • rbtools.api.resource.validate_diff_commit
  • rbtools.api.resource.validate_diff
  • rbtools.api.resource.validation
  • rbtools.api.resource.watched_review_group
  • rbtools.api.resource.watched_review_request
  • rbtools.api.resource.watched
  • rbtools.api.resource.webhook
  • rbtools.clients
  • rbtools.clients.base
  • rbtools.clients.base.patch
  • rbtools.clients.base.registry
  • rbtools.clients.base.repository
  • rbtools.clients.base.scmclient
  • rbtools.clients.errors
  • rbtools.clients.bazaar
  • rbtools.clients.clearcase
  • rbtools.clients.cvs
  • rbtools.clients.git
  • rbtools.clients.mercurial
  • rbtools.clients.perforce
  • rbtools.clients.plastic
  • rbtools.clients.sos
  • rbtools.clients.svn
  • rbtools.clients.tfs
  • rbtools.config
  • rbtools.config.config
  • rbtools.config.loader
  • rbtools.diffs
  • rbtools.diffs.patches
  • rbtools.diffs.patcher
  • rbtools.diffs.tools
  • rbtools.diffs.tools.backends
  • rbtools.diffs.tools.backends.gnu
  • rbtools.diffs.tools.base
  • rbtools.diffs.tools.base.diff_file_result
  • rbtools.diffs.tools.base.diff_tool
  • rbtools.diffs.tools.errors
  • rbtools.diffs.tools.registry
  • rbtools.diffs.writers
  • rbtools.commands
  • rbtools.commands.main
  • rbtools.commands.base
  • rbtools.commands.base.commands
  • rbtools.commands.base.errors
  • rbtools.commands.base.options
  • rbtools.commands.base.output
  • rbtools.commands.alias
  • rbtools.commands.api_get
  • rbtools.commands.attach
  • rbtools.commands.clearcache
  • rbtools.commands.close
  • rbtools.commands.diff
  • rbtools.commands.info
  • rbtools.commands.install
  • rbtools.commands.land
  • rbtools.commands.list_repo_types
  • rbtools.commands.login
  • rbtools.commands.logout
  • rbtools.commands.patch
  • rbtools.commands.post
  • rbtools.commands.publish
  • rbtools.commands.review
  • rbtools.commands.setup_completion
  • rbtools.commands.setup_repo
  • rbtools.commands.stamp
  • rbtools.commands.status
  • rbtools.commands.status_update
  • rbtools.hooks
  • rbtools.hooks.common
  • rbtools.hooks.git
  • rbtools.testing
  • rbtools.testing.api
  • rbtools.testing.api.payloads
  • rbtools.testing.api.transport
  • rbtools.testing.commands
  • rbtools.testing.testcase
  • rbtools.testing.transport
  • rbtools.utils
  • rbtools.utils.aliases
  • rbtools.utils.browser
  • rbtools.utils.checks
  • rbtools.utils.commands
  • rbtools.utils.console
  • rbtools.utils.diffs
  • rbtools.utils.encoding
  • rbtools.utils.errors
  • rbtools.utils.filesystem
  • rbtools.utils.graphs
  • rbtools.utils.mimetypes
  • rbtools.utils.process
  • rbtools.utils.repository
  • rbtools.utils.review_request
  • rbtools.utils.source_tree
  • rbtools.utils.users
  • Glossary
  • General Index
  • Python Module Index
  • Release Notes
  • rbtools.clients.clearcase¶

    A client for ClearCase.

    Classes

    ClearCaseClient(**kwargs)

    A client for ClearCase.

    ClearCaseRepositoryInfo(path, vobtag)

    A representation of a ClearCase source code repository.

    DirectoryDiff

    A difference between two directories.

    LabelElementInfo

    Information about an element in a label.

    class rbtools.clients.clearcase.ClearCaseClient(**kwargs)[source]¶

    Bases: BaseSCMClient

    A 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.

    CHECKEDOUT_RE = re.compile('CHECKEDOUT(\\.\\d+)?$')[source]¶
    REVISION_ACTIVITY_BASE = '--rbtools-activity-base'[source]¶
    REVISION_ACTIVITY_PREFIX = 'activity:'[source]¶
    REVISION_BASELINE_BASE = '--rbtools-baseline-base'[source]¶
    REVISION_BASELINE_PREFIX = 'baseline:'[source]¶
    REVISION_BRANCH_BASE = '--rbtools-branch-base'[source]¶
    REVISION_BRANCH_PREFIX = 'brtype:'[source]¶
    REVISION_CHECKEDOUT_BASE = '--rbtools-checkedout-base'[source]¶
    REVISION_CHECKEDOUT_CHANGESET = '--rbtools-checkedout-changeset'[source]¶
    REVISION_FILES = '--rbtools-files'[source]¶
    REVISION_LABEL_BASE = '--rbtools-label-base'[source]¶
    REVISION_LABEL_PREFIX = 'lbtype:'[source]¶
    REVISION_STREAM_BASE = '--rbtools-stream-base'[source]¶
    REVISION_STREAM_PREFIX = 'stream:'[source]¶
    __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 by parse_revision_spec().

    • include_files (list of str, optional) – A list of files to whitelist during the diff generation.

    • exclude_patterns (list of str, 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:

    dict

    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:

    tuple

    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:

    str

    get_repository_info() → RepositoryInfo | None[source]¶

    Return repository information for the current working tree.

    Returns:

    The repository info structure.

    Return type:

    ClearCaseRepositoryInfo

    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:
    • Product name (str) – The name portion of the Product key.

    • Product version (str) – The version portion of the Product key.

    Callers must call setup() or has_dependencies() before accessing this.

    They also must check for None responses and exceptions.

    Changed in version 4.0: Made this a lazily-loaded caching property.

    Type:

    dict

    Raises:

    rbtools.clients.errors.SCMError – There was an error fetching host property information.

    is_ucm: bool¶

    Whether the ClearCase setup is using UCM.

    name: str = 'ClearCase'[source]¶

    The name of the client.

    Type:

    str

    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 (list of str, 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 and tip.

    Return type:

    dict

    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 False if no command line tool is required, or True if 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.

    Type:

    bool or list

    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:

    str

    server_tool_ids: ClassVar[Sequence[str] | None] = ['clearcase', 'versionvault'][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.

    Added in version 5.0.1.

    Type:

    str

    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:

    str

    supports_patch_revert: bool = True[source]¶

    Whether the SCM client supports reverting patches.

    Type:

    bool

    viewname: str | None¶

    The name of the user’s view.

    viewtype: str | None¶

    The user’s ClearCase view type.

    This will be either snapshot or dynamic.

    vobtag: str | None¶

    The current repository’s VOB tag.

    This is only used for matching the Review Board server repository.

    class rbtools.clients.clearcase.ClearCaseRepositoryInfo(path: str, vobtag: str)[source]¶

    Bases: RepositoryInfo

    A 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¶
    __init__(path: str, vobtag: str) → None[source]¶

    Initialize the repsitory info.

    Parameters:
    • path (str) – The path of the repository.

    • vobtag (str) – The VOB tag for the repository.

    __static_attributes__ = ('base_path', 'is_legacy', 'path', 'uuid_to_tags', 'vob_tags', 'vob_uuids', 'vobtag')¶
    is_legacy: bool¶

    Whether the server uses the legacy ClearCase SCMTool.

    Type:

    bool

    tool: ClearCaseClient¶

    The SCM client.

    Type:

    ClearCaseClient

    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.

    uuid_to_tags: dict[str, list[str]]¶

    A mapping from VOB UUID to matching VOB tags.

    Type:

    dict

    vob_tags: set[str]¶

    The set of VOB tags that the server has registered.

    Type:

    set of str

    vob_uuids: list[str]¶

    A list of the VOB UUIDs that the server has registered.

    Type:

    list of str

    class rbtools.clients.clearcase.DirectoryDiff[source]¶

    Bases: TypedDict

    A 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.

    class rbtools.clients.clearcase.LabelElementInfo[source]¶

    Bases: TypedDict

    Information about an element in a label.

    Added in version 5.0.

    __firstlineno__ = 93¶
    __static_attributes__ = ()¶
    oid: str¶

    The element’s OID.

    version: str¶

    The version of the element in the label.

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2026 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]
    • ClearCaseClient
      • ClearCaseClient.CHECKEDOUT_RE
      • ClearCaseClient.REVISION_ACTIVITY_BASE
      • ClearCaseClient.REVISION_ACTIVITY_PREFIX
      • ClearCaseClient.REVISION_BASELINE_BASE
      • ClearCaseClient.REVISION_BASELINE_PREFIX
      • ClearCaseClient.REVISION_BRANCH_BASE
      • ClearCaseClient.REVISION_BRANCH_PREFIX
      • ClearCaseClient.REVISION_CHECKEDOUT_BASE
      • ClearCaseClient.REVISION_CHECKEDOUT_CHANGESET
      • ClearCaseClient.REVISION_FILES
      • ClearCaseClient.REVISION_LABEL_BASE
      • ClearCaseClient.REVISION_LABEL_PREFIX
      • ClearCaseClient.REVISION_STREAM_BASE
      • ClearCaseClient.REVISION_STREAM_PREFIX
      • ClearCaseClient.__firstlineno__
      • ClearCaseClient.__init__()
      • ClearCaseClient.__static_attributes__
      • ClearCaseClient.check_dependencies()
      • ClearCaseClient.diff()
      • ClearCaseClient.find_matching_server_repository()
      • ClearCaseClient.get_local_path()
      • ClearCaseClient.get_repository_info()
      • ClearCaseClient.host_properties
      • ClearCaseClient.is_ucm
      • ClearCaseClient.name
      • ClearCaseClient.parse_revision_spec()
      • ClearCaseClient.requires_diff_tool
      • ClearCaseClient.scmclient_id
      • ClearCaseClient.server_tool_ids
      • ClearCaseClient.server_tool_names
      • ClearCaseClient.supports_patch_revert
      • ClearCaseClient.viewname
      • ClearCaseClient.viewtype
      • ClearCaseClient.vobtag
    • ClearCaseRepositoryInfo
      • ClearCaseRepositoryInfo.__firstlineno__
      • ClearCaseRepositoryInfo.__init__()
      • ClearCaseRepositoryInfo.__static_attributes__
      • ClearCaseRepositoryInfo.is_legacy
      • ClearCaseRepositoryInfo.tool
      • ClearCaseRepositoryInfo.update_from_remote()
      • ClearCaseRepositoryInfo.uuid_to_tags
      • ClearCaseRepositoryInfo.vob_tags
      • ClearCaseRepositoryInfo.vob_uuids
    • DirectoryDiff
      • DirectoryDiff.__firstlineno__
      • DirectoryDiff.__static_attributes__
      • DirectoryDiff.added
      • DirectoryDiff.deleted
      • DirectoryDiff.renamed
    • LabelElementInfo
      • LabelElementInfo.__firstlineno__
      • LabelElementInfo.__static_attributes__
      • LabelElementInfo.oid
      • LabelElementInfo.version