Clearcase config spec for different selection rules per vob in view - clearcase

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".

Related

ClearCase Snapshot View Not Updating

I am using ClearCase for the first time, and am having a little trouble understanding snapshot views. I have a view with the config spec
element * CHECKEDOUT
element * /main/dev/LATEST
load "\project\dir1"
load "\project\dir2"
load "\project\dir3"
I am using the same config spec with a dynamic view without the load rules. I have checked in a file called "configSpecTest.txt" into "\project\dir1\subdir", and this shows up in my dynamic view.
However, after calling
cleartool update
and being told it successfully updated, the file is not there in my snapshot view. I feel like I have a fundamental misunderstanding as to how snapshot views work. Could anyone please explain to me where I'm going wrong?
Try with a config spec like:
element * CHECKEDOUT
element * .../dev/LATEST
element * /main/LATEST -mkbranch dev
load "\project\dir1"
load "\project\dir2"
load "\project\dir3"
You should always need the last selection rule element * /main/LATEST because to load/access an element, you need to load/access its parent element, and it is possible that /project does not have any version in the dev branch.
While your element is visible in your dynamic view, try and see if it is visible in another dynamic view with your original config spec mentioned in your question.
Try and create again your element with your dynamic view and the config spec mentioned above: that is how you create new branches for element.
See more at "ClearCase Branching using configspec"

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.

How to checkout multiple times using different branches for the same element inside same view of Clearcase

How do I checkout different branches of the same element in the same view by modifying the config_spec accrodingly in Clearcase?
Clearexplorer is giving message that already another version is checkedout in the same view, even though I have selected another branch in the config_spec rule correctly.
Any clue will help me.
Thank you.
Hello,
I added the VERSION TREE Picture where it shows that another CHECKEDOUT element is UNRESERVED mode. So, checkout on another branch of the same element in the same dynamic view fails with the message that another element version is already checkedout.
Error Message is also attached by creating another UNRESERVED CHECKOUT as shown.
The view is set to select only one version at a time.
If you want to checkout in another branch using the same view, you would always get the error message stating that the file is already checked out in the current view.
You can try change the config spec in order to:
select a non-checked out version of the file
make sure the checkout will create a new branch
But even in that case, ClearCase might refuse to check out twice that file in the same view.
Don't forget the selection rules in the config spec are read from top to bottom: the first one which can be applied applies.
So when you say "I have selected another branch in the config_spec rule correct", make sure that rule is in the top.
But I don't believe the error message will be different.
That issue is different from "How to Checkout (reserved) an element that is already checked out (reserved) in another view", where the solution is simply to checkout unreserved.
As your screenshot shows (from the position of the "eye"), your config spec select:
checked out version first
/main/LATEST
You would need to put a selection rule at the top of your config spec in order to:
select LATEST of app_build_changes
That is:
element * .../app_build_changes/LATEST
element * /main/LATEST -mkbranch app_build_changes
element /main/0 -mkbranch app_build_changes
But since:
the very first rule would still be element * CHECKEDOUT
you already have a CHECKEDOUT version
Your other rules would still be ignored, and the eye would still select the version you show in the first screenshot.
In short: use another dynamic view.
Instead of using
element * CHECKEDOUT rule in the config_spec,
if I change it to
element * /main/CHECKEDOUT -- one time when I am in main trunk
element * /main/app_build_changes/CHECKEDOUT -- another time when I am in branch
Then also it doesn't check out and gives me the same error of duplicate checkout in the same view.

How can I retrieve a file through Label in Config Spec?

I have labelled a file "Test.java" with a label called "My_Label".
When I try creating a view with the below config specs, I am unable to get the file in Clearcase Explorer.
element * CHECKEDOUT
element * My_Label
Could anyone please tell where am I going wrong in the above config spec?
That selection rule alone isn't enough.
You need to add, before that rule, other rules that will select the right version of the parent directories.
In other words, if your parent directory (or one of the ancestors) of Test.java isn't labelled with My_Label, it won't be selected at all.
So your file won't be accessible by your view, even though you have the correct selection rule for you file.
Check if the Vob itself has been labelled with MyLabel.
If not, I would recommend at least to add one final "stop" rule (/main/LATEST: see "ClearCase Branching using configspec" for an illustration of that rule):
element * CHECKEDOUT
element * My_Label
element * /main/LATEST

Config spec for applying a label

How to apply a label To the latest version of a branch Using config Spec?
Can we apply a label using the Config spec.
Well I have created branches using the Config spec but I applied labels using the apply label option.
But i want to apply it by giving it in the config spec.
Can we do it if so how?
I tried it but Its not working.Thank you in advance
element * CHECKEDOUT
element /test_ari/karthik/omna.txt .../karthik_9/LATEST/karthik_66
element * /main/LATEST
I want to create a label karthik_66 on karthik_9/LATEST using config spec rules but how do i make it?
According to the config spec rules man page, you can use labels within a config spec to select a version, not to label one.
So "no".
When you create/manage a branch, you need 3 rules, not 1 like yo currently have:
element * CHECKEDOUT
# 3 rules here:
element /test_ari/karthik/* .../karthik_9/LATEST
element /test_ari/karthik/* /main/LATEST -mkbranch karthik_9
element /main/0 .../karthik_9/LATEST
element * /main/LATEST
That would create a branch for any file (not just omna.txt) inside /test_ari/karthik, as well for any new file (the /main/0 selection rule).
Since you view would always refers to .../karthik_9/LATEST, you can then apply your label at any time, setting it on the LATEST of karthik_9.

Resources