Saturday, November 27, 2010

ClearCase Branching using configspec

The problem is:

What directories actually have:

a version in the branch BR_PHASE2 ?a version labeled LBL_MS_PHASE2_04-NOV-2010 ?

If you only branch/labeled all files under /myVob/myDirectory, then the directory /myVob itself won't never be branched/labeled.

That means the following config spec won't be able to select any version for /myVob, making all the other rules for any file under /myVob useless:
Until ClearCase is able to select at leat one valid version of /myVob, it won't be able to select any version for any file under /myVob.

element * CHECKEDOUT element * /main/BR_PHASE2/LATEST

You should always end your config spec with a "config stop-rule" like:

element * /main/LATEST

or at least:

element /myVob /main/LATEST

Add one of those at the end of your config spec, and the view should work as expected.

The ClearCase config spec mechanism is a composition-based one: to know more about it, see the SO answer "Flexible vs static branching (GIT vs Clearcase/Accurev)".

The OP adds:

You have mentioned to always end the cs with: element * /main/LATEST,

Not necessarily:

If you want to be sure to only view the files under /myVob/myDir with the right branch/label, you could use as I mentioned above:

element /myVob /main/LATEST

The rule applies only to /myVob (not to anything under /myVob).
That allows ClearCase to get past /myVob (because it can at least select a valid version for it) and start applying the other selection rules to the sub-directories.

but if I want to check out the files only from the branch BR_PHASE2, wont this create an error. I am saying that when I end it with /main/LATEST and checkout and check in files , it is updated in main branch. what do I do about it ?

It depends on the config spec you are using:

element * CHECKEDOUTelement * /main/BR_PHASE2/LATESTelement * /main/LATEST

would indeed create new version in the main branch

element * CHECKEDOUTelement * .../BR_PHASE2/LATESTelement * /main/LBL_MS_PHASE2_04-NOV-2010 -mkbranch BR_PHASE2 element * /main/LATEST

would not, because the third rule would apply first, if the element has been labeled LBL_MS_PHASE2_04-NOV-2010.


View the original article here

No comments:

Post a Comment