Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find Branch name of clearcase view

Tags:

clearcase

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

like image 604
srinannapa Avatar asked Sep 23 '10 10:09

srinannapa


1 Answers

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:

  • How would you select versions from a specific branch in ClearCase? for a concrete example.
  • How best to branch in Clearcase? to see how branches work.

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.

like image 119
VonC Avatar answered Oct 03 '22 00:10

VonC