clearcase create a branch into another branch - clearcase

I have a branch created into the main with this config spec:
element * CHECKEDOUT
element * /main/teste_branch_nv0/LATEST
element * /main/LATEST -mkbranch teste_branch_nv0
element * /main/LATEST
Now, I want to create other branch into this branch. I am trying to use:
element * CHECKEDOUT
element * /main/teste_branch_nv0/teste_branch_nv1/LATEST
element * /main/teste_branch_nv0/LATEST -mkbranch teste_branch_nv1
element * /main/teste_branch_nv0/LATEST
but, I have a mistake:
Problems performing setcs.
ClearCase CM Server: Error: Unable to determine version for VOB root directory element.
ClearCase CM Server: Error: Unable to access "\PROJECT\IMPLEMENTATION\Fonts\ENVIRONMENT\workspace": No such file or directory.
ClearCase CM Server: Error: 1 config spec load rule problems encountered.
This is the same path that I use to create the branch teste_branch_nv0
How can I avoid this error?

You seem to have left out the rule
element * /main/LATEST -mkbranch teste_branch_nv0
element * /main/LATEST
The "stop rule" element * /main/LATEST is particularly important, because it is the one rule that will always apply.
If you have an element (like the root folder of your Vob) for which no rule apply, then you would get
Unable to determine version for VOB root directory element
That is why you should always keep as a last rule the element * /main/LATEST selection one.
See as an example "ClearCase Branching using configspec".
It will also show you that the LATEST selection rules should be written as:
element * .../teste_branch_nv1/LATEST
Because you don't know from which branch (main or teste_branch_nv0) the new teste_branch_nv1 branch will be created.
So the full config spec should be:
element * CHECKEDOUT
element * .../teste_branch_nv1/LATEST
element * .../teste_branch_nv0/LATEST -mkbranch teste_branch_nv1
element * /main/LATEST -mkbranch teste_branch_nv1

Related

Base Clearcase - A particular config spec

I want the LATEST archived elements everywhere except in folder /view/my_view/vobs/the_vob/xxx/yyy/ where I want elements tagged LBL_01. The config spec below doesn't work.
element /the_vob/xxx/yyy/... LBL_01
element * CHECKEDOUT
element * /main/LATEST
You cannot apply the rule directly to /the_vob/xxx/yyy/
You need first to select the parent folder versions:
/the_vob
/the_vob/xxx
So:
element * CHECKEDOUT
element /thevob /main/LATEST
element /thevob/xxx /main/LATEST
element /the_vob/xxx/yyy/... LBL_01
element * /main/LATEST
The order is important: first select the parent folders, then apply your special rules.
If this is on Unix, the VOB tag to use would be /vobs/the_vob and not /the_vob. The path in the element line needs to be the VOB tag as shown by lsvob on the view server.
I am guessing that by "doesn't work" you mean a cleartool ls shows that you're seeing /main/LATEST as the rule.

Extracting Code from two different Release labels in Clearcase

I have a code base which is drawn from the below config spec in clearcase.
element * CHECKEDOUT
element lost+found -none
element * ...\CRM_703_FP2_COE\LATEST
element * CRM_703_FP2_RELEASE -mkbranch CRM_703_FP2_COE
element * \main\0 -mkbranch CRM_703_FP2_COE
But from the above code base i have around 400 files to be drawn from another label called CRM_703_FP2_SPLIT instead of CRM_703_FP2_RELEASE.
How can i achieve this? Can i add these 400+ files along with their full path and the required release label in the above config spec to achieve this? If so how?
You need to add an extra selection rule at the right place
element * CHECKEDOUT
element lost+found -none
element * ...\CRM_703_FP2_COE\LATEST
element * CRM_703_FP2_SPLIT -mkbranch CRM_703_FP2_COE
element * CRM_703_FP2_RELEASE -mkbranch CRM_703_FP2_COE
element * \main\0 -mkbranch CRM_703_FP2_COE
The order is important (first rule that applies wins), and here versions labeled with CRM_703_FP2_SPLIT will be selected first, before versions labeled with CRM_703_FP2_RELEASE.

ClearCase config spec rebasing

I need to merge all sub-branches into m_tool so that I can get the desired config spec.
I am trying to use my company's rebase tool but I get an warning saying that my config spec only supports branch-to-branch rebasing.
Could you please tell me what do I need to do?
I understand that element * TAG_2010_OCT_02 and element * TAG_2010_02_DEV_BASE are tags.
This is my desired config spec:
element * CHECKEDOUT
element * DATASOURCE
element /entities/... /main/LATEST
element * .../m_tool/LATEST
mkbranch m_tool
element * /main/LATEST
end mkbranch m_tool
This is my original config spec:
element * CHECKEDOUT
element * DATASOURCE
element /entities/... /main/LATEST
element * .../m_tool/LATEST
mkbranch m_tool
element * .../branch2011/LATEST
element * TAG_2010_OCT_02
element * .../m_dd_lt_hfix/LATEST
element * TAG_2010_02_DEV_BASE
element * /main/LATEST
end mkbranch m_tool
If you are not using UCM inter-project deliver, then your error message ("config spec only supports branch-to-branch rebasing") really depends on the way your company merge tool is implemented.
What you can try (similar to what I suggested to your previous question) is:
keep your original config spec
make a second view with a target config spec like:
element * CHECKEDOUT
element * DATASOURCE -mkbranch m_tool
element /entities/... /main/LATEST -mkbranch m_tool
element * .../m_tool/LATEST -mkbranch m_tool
element * /main/LATEST -mkbranch m_tool
And try merging what you see in the first view to the second view.
But again, that depends on the exact capabilities of your company merge tool.

Can't Create Directory Element With Multi-Branching in Base ClearCase

I am workng with base ClearCase. Please consider my config spec:
element * CHECKEDOUT
element /cl5_sw_ste/DCT/*/... /main/rel_drop5/int_drop5/cl5_p65719_AUTE/LATEST
element /cl5_sw_ste/DCT/*/... /main/rel_drop5/int_drop5/LATEST -mkbranch cl5_p65719_AUTE
element /cl5_sw_ste/DCT/*/... /main/rel_drop5/LATEST -mkbranch int_drop5
element /cl5_sw_ste/DCT/*/... /main/0 -mkbranch rel_drop5
INTENT: Any checkout of existing elements automatically occurs on branch /main/rel_drop5/int_drop5/cl5_p65719_AUTE and that this branching scheme is used automatically for the creation of any new elements (of which I presently have none).
When I navigate to the root of VOB cl5_sw_ste in ClearCase Explorer, select New--> Folder from the right pane's context menu, and try to create my first element---directory element DCT---, I receive the following error:
The system cannot find the file specified.
Why is this occurring?
Thanks,
Dave
Those selection rules are for elements inside DCT, not for DCT itself.
When you are adding DCT, it creates a version in /main/0.
And none of your rules selects /main/0.
you should add least add one selection rule at the end:
element * /main/LATEST
That is called a "config stop-rule", as illustrated in "ClearCase Branching using configspec".

ClearCase Branching using configspec

I have very little knowledge about ClearCase and would like to learn more.
I have created a branch BR_PHASE2 under /main.
I have used the following command to checkout the files into the branch:
element * CHECKEDOUT
element * .../BR_PHASE2/LATEST
element * /main/LBL_MS_PHASE2_04-NOV-2010 -mkbranch BR_PHASE2
The problem now is how do I access files from the branch ??
I am not able to even open the VOB if I switch to this config spec:
element * CHECKEDOUT
element * /main/BR_PHASE2/LATEST
Am I writing the config spec wrong ?? The error i am getting when I try to set the config spec as above:
Warning: New config spec makes current working dir invisible.
What are the steps to actually access the branch that I have created ??
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 * CHECKEDOUT
element * /main/BR_PHASE2/LATEST
element * /main/LATEST
would indeed create new version in the main branch
element * CHECKEDOUT
element * .../BR_PHASE2/LATEST
element * /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.
Your first config spec seems to be ok. It sais that all the files you try to change from the label 'LBL_MS_PHASE2_04-NOV-2010' will be branched to BR_PHASE2. Just try to checkout something, and watch the version tree.
Also, the second config spec tells to see all the files, that belong ONLY to the branch, but if you haven't checkout to branch any, then you will see nothing.
Try the following:
element * CHECKEDOUT
element * /main/LBL_MS_PHASE2_04-NOV-2010
element * /main/BR_PHASE2/LATEST
so that you have the directory structure by selecting the label and your files from branch.

Resources