How can we find the branch name to which my ClearCase view is pointed to?
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.
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.