How to associate a clearcase view with stream or vob? - clearcase

Below command is to make a view:
ct mkview -tag myview /var/tmp/your-username_dynview.vws
However, how do we know that [myview] is a view to certain stream ?
There's no specified arguments on above command indicating which stream a view is for.
Please read this:
https://publib.boulder.ibm.com/infocenter/cchelp/v7r1m0/index.jsp?topic=/com.ibm.rational.clearcase.tutorial.doc/topics/a_crview_ux.htm
Is it because that above command is for base clearcase view, not for UCM view ?
If so, how it is possible for a view to work with stream or vob in base clearcase ?
I'm confused.

You need to add the -stream parameter (following cleartool mkview man page).
ct mkview -tag myview -stream MyStream#/vobs:MyPVob /var/tmp/your-username_dynview.vws
See for instance "How do I create a snapshot view of some project or stream in ClearCase?".
-str/eam stream-selector
Specifies a UCM stream. The view being created is attached to this stream. (Cannot be used with –reg/ion.)
stream-selector is of the form [stream:]stream-name[#vob-selector], where vob-selector specifies the stream's project VOB.
So the -stream is the only difference between a base ClearCase view, and an UCM view.

Related

Clearcase: Activity branch information

Is there any command which will display all the information associated with a particular activity branch. Like:
On which label it was created?
On which label currently it is?
What are the files are checked in the branch. What are there latest versions?
Who created this branch?
Is there any single command for all those which will display these information (not in graphical view)
The only two commands are:
cleartool lsact
cleartool descr -l activity:anActivity#/apvob
You can get that way the list of versions for each file.
See also "Cleartool command to list all files part of a changeset"
You can combine the second command (descr) with a -fmt (fmt_ccase) directive in order to get other activity attributes, like its associated view (from which you can deduce the stream)
But that won't give you from which label the activity started. For that, you can list the foundation baseline of the stream.
And that won't give you "On which label currently it is?": the activity list versions. The fact that those versions are or are not labelled is not relevant for the activity. You would need to describe the version in order to see if it has a label attached to it.
If this is UCM, and by "activity branch" you mean the stream it is on, you can get the information about the stream by using cleartool lsstream -long -cview while in the view in question. The output will look something like this:
stream "brian_testrep1_2"
2017-08-17T17:50:15-04:00 by Brian.None#DESKTOP-LQ0QA86
owner: DESKTOP-LQ0QA86\Brian
group: DESKTOP-LQ0QA86\None
project: testrep1#\testproject (development stream)
default deliver stream: testrep1_Int#\testproject
development streams:
contains activities:
foundation baselines:
test_2#\testproject (testcomp1#\testproject) (modifiable)
recommended baselines:
views:
Brian_testrep1_2
policies:
...

Unset activity for deleted view in clearcase

How to release activity for view that has been deleted.
There are no reference in pvob or cvob for that removed view Tried cleartool desc -l vob:/vobs/test_pvb
There are no refernece in either pvob or cvob
You could try setting the activity to an existing view. If you do not have an existing view associated with the stream, create a new one with cleartool mkview -stream option. Then:
$ cleartool setact -view <new-view-tag> activity:<activity-name>#<pvob>
Once the activity transferred to , you could then do:
$ cleartool setact -view <new-view-tag> -none
So that the activity will not be associated with any view at all.
The normal command to release an activity is cleartool setact -none -view viewtag.
But if the view has been rmtagged as well as unregistered, that would no longer be possible.
The view would need to be at least registered and tagged again: check if a cleartool descr -l activity:myActivity/vobs/test_pvb does mention anything about the view in which the activity is set.
Check also if this activity is an integration activity that is in use as part of a deliver or rebase operation: as mentioned in "IBM technote", you could not clear it that way either.

Clearcase UCM - How to get the config spec of a given baseline?

I'd like to set-up a non-UCM clearcase (read only) view for debugging an issue reported on a old baseline which was delivered to customer.
How to view/retrieve/generate the config spec of the old baseline? so that I use this config spec to create a non-UCM clearcase view for debugging the issue.
The config spec is simple:
element * baseline_id
element * /main/0
element * /main/LATEST
(note that the /main/0 is important, especially in a multi-component vob, for the initial version of the component is registered in /main/0 when a new component is created)
What you need to find out is:
what is the baseline id? (which can differ from the baseline title).
See "Display Current Baseline with Cleartool".
You can for instance describe the stream to get the foundation baselines id:
cleartool descr -fmt "%[found_bls]CXp" stream:myStream#\myPVob
is the baseline a full or an incremental one? See "What is the difference between Full baseline and Incremental baseline in Clearcase UCM?".
If it is an incremental one, you need first to promote the baseline to a full one.
ct chbl -full -nc baseline:abaselinexxx.yyyy#\apvob
I think a much simple solution is to create a stream based on the baseline you have. That way you can even write into it without interfering nothing and even to save you changes in CC
It's very simple to create a stream based on a baseline, click the "advanced" option when creating stream as usual.
Enjoy,
Eli.

Clearcase [not loaded]

When I execute a "cleartool ls filename##specificVersion", I see
filename [not loaded]
What does this mean?
For background information, I was trying to also execute a cleartool mkbranch, and was a "Element not found" error. So, for a sanity check, I tried a cleartool ls.
"not loaded" means the file:
is selected (by the selection rules element * ...) but:
not loaded by the load rules (load /xx/yy...)
You can see both sets of rules by doing a cleartool catcs anywhere within your view (or cleartool edcs to edit said rules)
This is typical of a snapshot view, which is the only one having "load rules" (as opposed to a dynamic view)
See:
"Before accessing files not loaded into snapshot views":
A snapshot view contains only the set of elements that you specify in the load rules of your view. (In UCM, by default, your view loads all of your project source files.)
When you restrict the scope of a view, it contains only a subset of elements in the VOB. During the course of a development cycle, you may need to see a version of an element that is not loaded into your snapshot view.
You can view nonloaded files or copy them into your view for build purposes, but you cannot check them out. Only file elements that are loaded into your view can be checked out.
"To copy a nonloaded element into a snapshot view"
cleartool get -to filename path
cleartool get -to prog.c.previous.version prog.c##/main/v3.1_fix/10

Clearcase command to check the existence of an element in a VOB

What would be the command to check the existence of an element (say named "XYZ") in a Clearcase VOB ?
You can start with cleartool describe:
clertool describe yourView/yourVob/yourFile
But that implies that you have a view first.
I would recommend a dynamic view, as it is easier/quicker to set up and use (no update like in a snapshot view).

Resources