Clearcase Branch configspec - clearcase

I need to create a new VOB and a branch to access the newly created VOB.
The development will not be on a main branch, so I create a release branch.
Once the development is done, the release branch will be merged to main branch.
How do I write a config spec for the initial branch so that it is derived of /main branch?
element /new_vob/... .../rel_branch/LATEST
mkbranch rel_branch
element /new_vob/... /main/0
end mkbranch rel_branch
Please suggest if the above look good.
Also suggest if any base LABEL is required at the start, there is no source for the VOB.
The development will happen over time.

If your new VOB is empty, you don't need a LABEL as a base for your release branch.
The placeholder version 0 of /main is enough.
Your (non-UCM) config spec would simply be:
element * CHECKEDOUT
element * .../release/LATEST
# (not needed yet) element * LABEL -mkbranch release
element * /main/0 -mkbranch release
element * /main/LATEST -mkbranch release
Once you have done one release, merged to /main, then it is a good idea to make a LABEL on /main, and make a new release2 branch starting from LABEL.
You can replace '*' by /new_vob/... if you want.
(If it is a dynamic view, with only new_vob mounted, it would have access only to new_vob anyway)

Related

Merged file not showing up in ClearCase

In ClearCase, I merged file ABC to a branch. This resulted in Version 1 in the version tree. I labeled it LAB_A1.
Later, I merged file XYZ to the same branch. This resulted in Version 2 in the version tree. I labeled it LAB_X1.
File ABC is missing in LAB_X1 and in the version tree Version 2.
I checked out Version 2 and tried to merge file ABC, ClearCase comes back stating there’s nothing to merge.
According to ClearCase file ABC already exists on Version 2.
In the version tree I did a diff between Versions 1 and 2.
You can clearly see the file ABC is missing from Version 2.
I need both files ABC and XYZ, in the latest version.
How do I do this?
I merged to our development branch.
Config spec:
element * CHECKEDOUT
element * LAB_X1
element lost+found -none
element * /main/0 -mkbranch DEV
When using label LAB_X1 in the config spec I can see file XYZ, but not ABC. I can see file ABC if I use LAB_A1 in my config spec.
You may edit your config spec (cleartool edcs) to show the latest version on your branch.
This should be enough for your case:
element * CHECKEDOUT
element * .../DEV/LATEST
element * /main/LATEST -mkbranch DEV
In this scenario, it doesn't care about labels at all and just selects the latest version of the directory and the files in it by first looking for the DEV branch and secondly for the main branch. With this change, both your files should become visible.
If the actual files don't have a DEV branch, you may need the labels too to select the versions you've labelled:
element * CHECKEDOUT
element * .../DEV/LATEST
element * LAB_X1 -mkbranch DEV
element * LAB_A1 -mkbranch DEV
element * /main/LATEST -mkbranch DEV
or simpler, add mkbranch DEV to all the rules that follows after the .../DEV/LATEST rule:
element * CHECKEDOUT
element * .../DEV/LATEST
mkbranch DEV
element * LAB_X1
element * LAB_A1
element * /main/LATEST
This resulted in Version 2 in the version tree.
That would be version 2 for the parent folder, not the file itself.
File ABC is missing in LAB_X1 and in the version tree Version 2.
It depends on your config spec, whose selection rules order matters.
But assuming those are correct, you can start and simply re-create file ABC in a checked out version of the parent folder, creating a version 3.
At most, you could have evil twins, but if you don't mind working from now on with that new ABC file, you should be fine.
However, the config spec you mention does not work for new elements, as it lacks a /main/LATEST backstop rule.

Clearcase config spec for different selection rules per vob in view

The team would like to perform their work with one webview (instead of a view for each vob). vob1 work should be done on main, whereas vob2 work should be done on a different branch (branch1 below). I am not sure what the conceptual problem is with my rules below. I expected that since clearcase will match rules from top to bottom it would apply the selections for vob1 I have specified.
The config Spec I tried will checkout files for vob1 on branch1 instead of main.
element * CHECKEDOUT
element /vobs/vob1/* .../main/LATEST
element /vobs/vob1/* /main/LATEST
element * .../branch1/LATEST
element * /main/LATEST -mkbranch branch1
element * /main/0 -mkbranch branch1
load /vobs/vob1
load /vobs/vob2
Is my desired goal possible? What is the error above?
First, don't hesitate to make a dynamic view in order to test your selection rules: you will see immediately if said selection matches what you need, without having to re-update your snapshot view.
Second, try element /vobs/vob1/... instead of /vobs/vob1/*: that will include the vob root folder itself.
See "Pattern" in the page "config_spec".

Branch elements not visible after relocation

I relocated certain elements from one VOB to another VOB.
During the relocation my view was set to default config spec.
element * CHECKEDOUT
element * main\LATEST
some of the elements were branched under another branch. Below is the config spec we use for the other branch.
element * CHECKEDOUT
element * .../rel_euchanges_ban_dev/LATEST
element * WPX0445_ANL_EXIT_EUCHGS_1.0_BL.ANL_28012014 -mkbranch
rel_euchanges_ban_dev
element * /main/LATEST -mkbranch rel_euchanges_ban_dev
After relocation when we set the config spec for rel_euchanges_ban_dev branch, we are not able to properly see the elements under this branch.
Example: This is how it looks in the source VOB, for two folders which are under the branch rel_euchanges_ban_dev. There seems to be a symbolic link to the destination VOB.
But at the destination VOB. This is how it looks.
When the config spec is set to default, AnalysisAndDesign and Requirements folder are present only in destination VOB as expected after relocation.
Why could it be that when config spec is set for rel_euchanges_ban_dev branch, we are seeing symbolic links? Wherein ideally the folders should be available at the source VOB but not symbolic links to destination VOB.
Why could this be happening? I tried labeling corresponding folders at the destination VOB with baseline label of the sub branch. But nothing seems to work :-/
Further, the version tree at the destination VOB looks like this.
View is set to rel_euchanges_ban_dev branch.
What could happen is the new config spec isn't configured to show new elements (those in /main/0 or .../branch rel_euchanges_ban_dev/0
element * CHECKEDOUT
element * .../rel_euchanges_ban_dev/LATEST
element * WPX0445_ANL_EXIT_EUCHGS_1.0_BL.ANL_28012014 -mkbranch
rel_euchanges_ban_dev
element * /main/0 -mkbranch rel_euchanges_ban_dev <===
element * /main/LATEST -mkbranch rel_euchanges_ban_dev
The additional line makes sure a new element added to source control immediately in the new branch.
The relocate man page mentions:
Use a view whose config spec selects the branch (typically main) on which the move is to occur.
The view in which you run relocate must be able to check out elements in both the source and target VOBs, so its config spec must include a CHECKEDOUT rule.
After you run relocate, you may need to use this view (or a view with the same config spec) to clean up, as described in Problems with existing views after relocating elements.
So the config spec above might have been better suited for the "working view" used by the relocate.

Details of config spec in base ClearCase

My base ClearCase config spec reads like this:
element * CHECKEDOUT
element * .../Branch_F13R2/LATEST
All is good, but I am wondering what is the .../ doing at the beginning of the path? In UCM, we can see the streams and VOBS in Clear Case explorer, but in base ClearCase, how to know that if I want to check out from Branch_F13R2, I need .../ at the beginning?
That is because you don't know the parent branch.
.../ in a selection rule allows for ClearCase to select that branch, from whatever branch it comes from: /main, or any other branch.
To see more about that notation, called ellipsis wildcard, see "Find all files modified in a specific ClearCase branch?".
I would also recommend to add the rule
element * /main/LATEST
Not every parent directory has a version in the branch you are looking for, and without this last selection rule, it would have nothing to select, making any sub element inaccessible.

Getting error while check out the file

Actually i created a view, branch and set the config secs for that view.
Its allowing to checkout the already existed files, but it does not allow to checkout the newly created files. its allow to create new elements by using "mkelem" command, but it does not allow to checkout that newly created file.
For newly created file, you should see a rule like:
element * /main/0 -mkbranch newBrach
See for illustration "Config spec rules for elements in subbranches":
element * CHECKEDOUT
element * .../bug-fix/LATEST
element * BASELINE-X -mkbranch bug-fix
element * /main/0 -mkbranch bug-fix
Rule 4 (fourth line) determines that when a new element is created, the mkbranch clause causes the new element to be checked out on the bug-fix subbranch which is created automatically with the mkbranch command.
Also, if an existing element does not have a bug-fix branch or a version with the BASELINE-X label, the bug-fix branch is created when you check out the element.
So examine your config spec, and check if that /main/0 -mkbranch is there:
cleartool catcs -tag yourViewTag
See "why I only get a clearcase version 0?" for more on that "version 0", when an element is created.

Resources