• 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 4.x
    2. Version 5.x
    3. Version 4.x
    4. Version 3.x
    5. Version 2.0
    6. Version 1.0
    7. Version 0.7
    8. Version 0.6
    9. Version 0.5
    10. RBTools Python API
    11. Module and Class References
    12. rbtools.clients.clearcase
  • Home
  • Installing RBTools
  • rbt Command
  • Configuration
  • Authenticating to Review Board
  • Repository Configuration
  • Per-User Configuration
  • Team Foundation Server Configuration
  • Commands
  • alias
  • api-get
  • attach
  • clear-cache
  • close
  • diff
  • install
  • land
  • list-repo-types
  • login
  • logout
  • patch
  • post
  • publish
  • review
  • setup-completion
  • setup-repo
  • stamp
  • status
  • status-update
  • RBTools Workflows
  • Using RBTools With Cliosoft SOS
  • Using RBTools with Git
  • Using RBTools with HCL VersionVault and IBM ClearCase
  • Using RBTools With Perforce
  • RBTools Python API
  • Overview of the Python API Client
  • Tutorial
  • Resource-Specific Functionality
  • 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.resource
  • rbtools.api.transport
  • rbtools.api.transport.sync
  • rbtools.api.utils
  • 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.diffs
  • 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.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.checks
  • rbtools.utils.commands
  • rbtools.utils.console
  • rbtools.utils.diffs
  • rbtools.utils.encoding
  • rbtools.utils.errors
  • rbtools.utils.filesystem
  • rbtools.utils.graphs
  • rbtools.utils.match_score
  • rbtools.utils.process
  • rbtools.utils.repository
  • rbtools.utils.review_request
  • rbtools.utils.source_tree
  • rbtools.utils.testbase
  • rbtools.utils.users
  • Glossary
  • General Index
  • Python Module Index
  • Release Notes
  • This documentation covers RBTools 4.x. You can select a version above or view the latest documentation.

    rbtools.clients.clearcase¶

    A client for ClearCase.

    Classes

    ChangesetEntry(root_path[, old_path, ...])

    An entry in a changeset.

    ClearCaseClient(**kwargs)

    A client for ClearCase.

    ClearCaseRepositoryInfo(path, vobtag[, tool])

    A representation of a ClearCase source code repository.

    class rbtools.clients.clearcase.ChangesetEntry(root_path, old_path=None, new_path=None, old_oid=None, new_oid=None, op='modify', is_dir=False)[source]¶

    Bases: object

    An entry in a changeset.

    This is a helper class which wraps a changed element, and centralizes/caches various information about that element’s old and new revisions.

    New in version 3.0.

    __init__(root_path, old_path=None, new_path=None, old_oid=None, new_oid=None, op='modify', is_dir=False)[source]¶

    Initialize the changeset entry.

    Parameters:
    • root_path (unicode) – The root path of the view.

    • old_path (unicode, optional) – The extended path of the “old” version of the element.

    • new_path (unicode, optional) – The extended path of the “new” version of the element.

    • old_oid (unicode, optional) – The OID of the “old” version of the element.

    • new_oid (unicode, optional) – The OID of the “new” version of the element.

    • op (unicode, optional) – The change operation.

    • is_dir (bool, optional) – Whether the changeset entry represents a directory.

    property vob_oid[source]¶

    The OID of the VOB that the element is in.

    Type:

    unicode

    property old_oid[source]¶

    The OID of the old version of the element.

    Type:

    unicode

    property old_name[source]¶

    The name of the old version of the element.

    Type:

    unicode

    property old_version[source]¶

    The version of the old version of the element.

    Type:

    unicode

    property new_oid[source]¶

    The OID of the new version of the element.

    Type:

    unicode

    property new_name[source]¶

    The name of the new version of the element.

    Type:

    unicode

    property new_version[source]¶
    __repr__()[source]¶

    Return a representation of the object.

    Returns:

    The internal representation of the object.

    Return type:

    unicode

    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.

    scmclient_id: str = 'clearcase'[source]¶

    The unique ID of the client.

    New in version 4.0: This will be required in RBTools 5.0.

    Type:

    str

    name: str = 'VersionVault / ClearCase'[source]¶

    The name of the client.

    Type:

    str

    server_tool_names: Optional[str] = 'ClearCase,VersionVault / ClearCase'[source]¶

    A comma-separated list of SCMClient names on the server

    New in version 3.0.

    Type:

    str

    requires_diff_tool: Union[bool, List[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.

    New in version 4.0.

    Type:

    bool or list

    supports_patch_revert: bool = True[source]¶

    Whether the SCM client supports reverting patches.

    Type:

    bool

    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]¶
    CHECKEDOUT_RE = re.compile('CHECKEDOUT(\\.\\d+)?$')[source]¶
    __init__(**kwargs)[source]¶

    Initialize the client.

    Parameters:

    **kwargs (dict) – Keyword arguments to pass through to the superclass.

    property host_properties: Optional[Dict[str, str]][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.

    check_dependencies() → None[source]¶

    Check whether all dependencies for the client are available.

    This will check for cleartool in the path.

    New in version 4.0.

    Raises:

    rbtools.clients.errors.SCMClientDependencyError – cleartool 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:

    str

    get_repository_info() → Optional[RepositoryInfo][source]¶

    Return repository information for the current working tree.

    Returns:

    The repository info structure.

    Return type:

    ClearCaseRepositoryInfo

    find_matching_server_repository(repositories)[source]¶

    Find a match for the repository on the server.

    Parameters:

    repositories (rbtools.api.resource.ListResource) – The fetched repositories.

    Returns:

    A 2-tuple of ItemResource. The first item is the matching repository, and the second is the repository info resource.

    Return type:

    tuple

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

    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.

    diff(revisions: SCMClientRevisionSpec, *, include_files: List[str] = [], exclude_patterns: List[str] = [], no_renames: bool = False, repository_info: Optional[RepositoryInfo] = None, extra_args: List[str] = [], **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 unicode, optional) – A list of files to whitelist during the diff generation.

    • exclude_patterns (list of unicode, optional) – A list of shell-style glob patterns to blacklist during diff generation.

    • repository_info (ClearCaseRepositoryInfo, optional) – The repository info structure.

    • extra_args (list, unused) – Additional arguments to be passed to the diff generation. Unused for ClearCase.

    • **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

    class rbtools.clients.clearcase.ClearCaseRepositoryInfo(path, vobtag, tool=None)[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.

    __init__(path, vobtag, tool=None)[source]¶

    Initialize the repsitory info.

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

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

    • tool (rbtools.clients.base.scmclient.BaseSCMClient) – The SCM client.

    update_from_remote(repository, info)[source]¶

    Update the info from a remote repository.

    Parameters:
    • repository (rbtools.api.resource.ItemResource) – The repository resource.

    • info (rbtools.api.resource.ItemResource) – The repository info resource.

    find_server_repository_info(api_root)[source]¶

    Find a matching repository on the server.

    The point of this function is to find a repository on the server that matches self, even if the paths aren’t the same. (For example, if self uses an ‘http’ path, but the server uses a ‘file’ path for the same repository.) It does this by comparing the VOB’s name and uuid. If the repositories use the same path, you’ll get back self, otherwise you’ll get a different ClearCaseRepositoryInfo object (with a different path).

    Deprecated since version 3.0: Commands which need to use the remote repository, or need data from the remote repository such as the base path, should set needs_repository.

    Parameters:

    api_root (rbtools.api.resource.RootResource) – The root resource for the Review Board server.

    Returns:

    The server-side information for this repository.

    Return type:

    ClearCaseRepositoryInfo

    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-2025 Beanbag, Inc. All rights reserved.

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

    On this page

    • [Top]