cleartool format string for displaying hyperlinks - clearcase

Is there a cleartool describe format string or any other command that will print only the hyperlinks from an object? Like:
cleartool describe -long -ahlink -all vob:\MyVOB
but without the leading information.

When I run the formatted describe, as long as you're not dealing with > 150K of hyperlink data per version, you get the hyperlinks:
[brian#bullwinkle bcowan-testvob1]$ cleartool desc -fmt "%n\t%[hlink:TextType]p\n" .##/main/0
.##/main/0 "TextType#2#/vobs/bcowan-testvob1" -> "foobar"
And without the filter (another element):
[brian#bullwinkle bc-linuxtest]$ cleartool desc -fmt "%n\t%[hlink]p\n" /view/bc-linuxtest/vobs/bc-linuxtest/.##/main/foo/2
/view/bc-linuxtest/vobs/bc-linuxtest/.##/main/foo/2 "Merge#2#/vobs/bc-linuxtest" <- "/view/bc-linuxtest/vobs/bc-linuxtest/.##/main/18"

Related

ClearCase: how to list the attributes attached to a branch

With the following, I can attach an attribute to a branch:
cleartool mkattr islocked \"true\" brtype:MY_BRANCH_NAME
How can I verify the value of this attribute?
As advised by VonC, I specified the VOB name in my command:
First let ensure the attribute exist and has been registered:
$ ct mkattype -replace -nc -enum \"true\",\"false\" -default \"false\" islocked
Replaced definition of attribute type "islocked".
-
$ ct mkattr -replace islocked \"true\" brtype:MY_BRANCH_NAME#\\myVOB
Created attribute "islocked" on "MY_BRANCH_NAME".
Then we can ask for the attribute's value:
$ ct desc -l brtype:MY_BRANCH_NAME#\\myVOB
branch type "MY_BRANCH_NAME"
created 2016-02-22T13:16:51Z by Nowox
master replica: cpAdmin#\myVOB
request for mastership: allowed for branch type
request for mastership: allowed for all instances
owner: user
group: group
scope: global
constraint: one version per element
Hyperlinks:
GlobalDefinition#78418#\myVOB <- brtype:MY_BRANCH_NAME#\myVOB
Unfortunately I don't see my attribute...
Same issue with this one:
$ ct desc -l -aattr islocked brtype:MY_BRANCH_NAME#\\myVOB
MY_BRANCH_NAME
cleartool describe can help:
cleartool desc -aattr myattribute brtype:MY_BRANCH_NAME
fmt_ccase has also an option to display the value:
clearcase desc -fmt "%Sa" brtype:MY_BRANCH_NAME
As Brian Cowan mentions in the comment, a cleartool descr -l can help ascertain if there is an attribute set and what its value is.
Compare that output with a cleartool descr -l -local to see if the attribute differs, and if the object is a local instance of a global type.
If the attribute has been define in an AdminPVob, check its type (global or local).
I have noticed similar issues on my side with the "cleartool desc" command. You can use the "cleartool dump" command in order to see the value of the attribute.
cleartool dump -l brtype:YOUR-BRANCH#/YOUR-VOB

How to retrieve the list of files modified in same branch for different component in clear case

I need to retrieve the list of changes or activity in same branch for different component(or Project group). Say I am committing the changes for two components ABC & xyz in same branch. And whenever I create build I apply the label abc.00.date & xyz.00.date respectively. Now major CQ's are of abc so whenever I make build for xyz and apply lable, label attach to abc chnages and when I compare the baseline with comapre tool, it shows the chnages of abc project also.
My requirement is to get the changes between label of xyz.00.date group ONLY as there is numerous lables of two groups in same branch.
I need to retrieve the list of changes or activity in same branch for different component
The main command remains cleartool lsactivity, as illustrated here:
foreach act ( `cleartool lsact -in astream#/vobs/avob` )
set changeset = `cleartool lsact -fmt "%[versions]p" $act`
echo $changeset | tr ' ' '\n' >> $tmpoutput
end
For the difference between baselines, use cleartool diffbl, as in "Why does Clearcase diffbl include activities from my development stream when I diff integration stream baselines?"
cleartool diffbl -nmerge -act bl1 bl2
That will give you a list of activities that you can feed to the foreach loop above, modified as:
foreach act ( `cleartool diffbl -nmerge -act bl1 bl2` )
On Windows, those unix commands are available with the installation of Gnu On Windows: uncompress, and add GoW\bin to your %PATH%.

Counting number of checkins per user in clearcase

I would like to get the number of total checkins per user within a certain time frame. This is the kind of result I am looking for:
User: xxxxx Count: 432
User: yyyyy Count: 22
etc
I can use find to list all checkins done by a user, but I am only interested in the count!
Edit: Finding number of checkins per one (known) user at a time would also be ok!
Edit: I also need to filter on a certain filetype, e.g. *.java !
Basically, you need to experiment with cleartool find, using directives from the query language such has:
created_since: For instance, this limit a query for the month of May:
cleartool find . –version "{brtype(main_dev) && created_since(30-Apr) && (! created_since(31-May)) }" -print
-user (login-name) : this limit for a period, for a given user
cleartool find . -user user1 -element "{created_since(date1) && !created_since(date2)}" -print
So basically, you need to process the result of a find query, in order to sort it by user, and by filename extension.
The only native tool (so without counting external non-free third-party tool) would be to experiment with the ClearCase Report Builder (or "Report Wizard"), and see if you can set the right filters.
(mentioned in "ClearCase list of files with given label type applied").

how to find the list activities delivered to integration stream on a particular day?

We use to take nightly builds irrespective of any files were delivered to integration stream or not. What i would like to do is , find the list of deliveries done on a particular day.
If there were no deliveries to integration stream then build will not be triggered.
Through project explorer itself we can see. but i would like to know from commands.
Any deliver in UCM will generate an activity call deliver.xxx.
Simply list all activities for a given Stream (see cleartool lsact man page)
–in stream-selector [ –r/ecurse ]
Displays a list of all activities in the specified stream.
With –r/ecurse, includes activities in child streams.
So:
cleartool lsact -in stream:aStream#\aPVob -fmt "%n %d\n"|grep deliver
And filter through the dates (%d) in order to get only the deliver activities for that day.
(stream:aStream#\aPVob is a "stream selector", although you can directly use aStream#\aPVob in this case: cleartool is expecting a stream name parameter after the -in option)

How to get the recent baselines of a project in clearcase

Can we get the list of baselines of a project in clearcase within in a certain time period, say, last 6 months.
The cleartool lsbl command usually lists baselines:
per streams
from the oldest to the most recent
If you can restrict your search to one stream (ct lsbl -stream ...), you need to list everything and then filter the result.
You can use the fmt option to display only the name of the baseline and its date.
cleartool lsbl -fmt "%d %n\" -stream...
You would get results like:
2007-01-10T12:41:45+01:00 MYBL_20070110.1263
2007-01-25T16:33:13+01:00 MYBL_20070125.3901
2007-01-26T12:25:23+01:00 MYBL_20070126.7020
2007-01-31T12:21:44+01:00 MYBL_20070131.7277
2007-02-01T16:54:21+01:00 MYBL_20070201.7671
From there, you can filter and/or sort the results.

Resources