How to create a ClearCase branch to a specific directory

1.4k views Asked by At

I'm trying to create a ClearCase view that obtains all files with a certain label applied. Additionally, I would like to be able to create a branch on files checked out in the "source" directory, and only the source directory (or its subdirectories). For example, I don't want to create a branch of files in the /vob/design directory.

I have the following config spec, but no branches get created. All checkouts occur only on the main branch.

element * CHECKEDOUT
element * .../my_branch/LATEST
element * /vob/source/MY_LABEL -mkbranch my_branch  # this should include subdirectories
element * MY_LABEL 
element * /main/LATEST

I have also tried the following, with the same unsuccessful results:

element * CHECKEDOUT
element * .../my_branch/LATEST
element * /vob/source/... -mkbranch my_branch 
element * MY_LABEL 
element * /main/LATEST
1

There are 1 answers

0
VonC On

See "Config Spec": the path is the first element (usually, you see '*'), then you see the selection rule.

That means "element * /vob/source/MY_LABEL" is false and mixes path and selection rule together, which doesn't make sense for ClearCase.

Instead try:

element * CHECKEDOUT
element * .../my_branch/LATEST
element /vob/source/* MY_LABEL -mkbranch my_branch  # this should include subdirectories
element * MY_LABEL 
element * /main/LATEST

The solution the OP has found follows precisely what I recommended above:

element * CHECKEDOUT 
element * .../8732EIS_low_power_branch/LATEST 
element /Mag_2010_platform/8732EIS/03_Design/Software/source/... 8732EIS_REL_5_4_5 -mkbranch 8732EIS_low_power_branch 
element * 8732EIS_REL_5_4_5 element 
* /main/LATEST

Regarding the path in config spec, see also "Paths in config spec element rules".