srinannapa
srinannapa

Reputation: 3207

How to find Branch name of clearcase view

How can we find the branch name to which my ClearCase view is pointed to?

Upvotes: 6

Views: 11757

Answers (2)

kolslorr
kolslorr

Reputation: 956

Von is correct.

However, to understand the branching selection for base clearcase, it is better to learn how the Config Specs works.

cleartool man edcs, and read the config_specs documentation.

Upvotes: 0

VonC
VonC

Reputation: 1324437

The thing is, a view doesn't point to one branch.
It only combines various element selection rules in the config spec, which makes it reflect a version on a branch at a given time, for a given tree/file.
See:

See also the debate on selection by composition vs. selection by revision to better understand why, by default, a ClearCase config spec doesn't necessary reference one branch.

The simpler way to check what is the current branch is:

  • cd /my/view/path/to/relevant/directory
  • cleartool ls

Example:

C:\views\myView\path\to\dir>cleartool ls
.checkstyle@@\main\MY_BRANCH_Dev\4                         Rule: ...\MY_BRANCH_Dev\LATEST
.classpath@@\main\MY_BRANCH_Int\ADV_ACC_Dev\1              Rule: ...\MY_BRANCH_Dev\LATEST
.classycle@@\main\MY_BRANCH_Int\ADV_ACC_Dev\0              Rule: ...\MY_BRANCH_Dev\LATEST

That view, for the path/to/relevant/directory path, point to branch MY_BRANCH_Dev


Note: With ClearCase UCM, this is simpler:

cleartool lsstream -cview

will give you the name of the name of the Stream (and by extension, the associated branch) on which the views points to.

Upvotes: 11

Related Questions