tags:

views:

29

answers:

2

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

+3  A: 

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.

VonC
Hi Von, say if I want to know the list of branches the clearcase view is pointed to?
srinannapa
@srinannapa Unless you are using UCM, the simplest way is to extract the branch names from the config spec (`cleartool catcs`)
VonC
A: 

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.

kolslorr