How to list all the obsolete labels in a VOB - clearcase

I need a command that could list all the obsolete labels in a VOB.
I tried
lstype -kind lbtype -obselete
But it lists all the lbtypes.

You could at least limit that list to type from the specifc vob with lstype:
cleartool lstype -invob \aVob -kind lbtype -obs
If that doesn't work, check that you have at least one label which is actually obsolete:
cleartool lslock lbtype:aLabel#\aVob
Note that lstype always list non-obsolete types.
It also lists obsolete ones if you add the -obsolete option. See an example at this technote
cleartool lstype -obsolete -kind trtype
2007-12-03 joeuser trigger type "checkin_trig" (locked)
2007-12-03 joeuser trigger type "checkout_trig" (obsolete)
That means you will have to grep the output for "obsolete".
As in:
cleartool lstype -obsolete -kind lbtype|grep obsolete

Related

How to get list of all the versions and labels applied for a particular file in clearcase?

I have a file
"N:\E123_view\ABC\XYZ\data.doc"
I want to get all the versions of the file and all the labels tagged to it.
One approach, in command line, is to use a version tree: cleartool lsvtree.
cd N:\E123_view\ABC\XYZ
cleartool lsvtree -all data.doc > afile.txt
lists all versions on a branch, not the selected versions only; annotates each version with all of its version labels.
Another approach is to use lshistory combined with fmt_ccase
cleartool lshistory -fmt "%n %l\n" data.doc
%n will print the version, as in /main/rel2_bugfix/1
%l will print the label (if present).

ClearCase: how to list non-obsolete sub-streams?

I have an integration stream in ClearCase. I want to get a list with the names of all of its child streams that aren't marked as obsolete. Which command should I run?
A simple cleartool lsstream -tree myIntStream#\myPvob should be enough.
(Unix: cleartool lsstream -tree myIntStream#/vobs/myPvob)
As mentioned in cleartool lsstream:
Default
Lists only nonobsolete streams.
neves adds in the comments:
This also list all the activities of the stream. I think it is necessary to pass something the fmt option. I'd like just the name of the streams.
As I mention in "cleartool lsstream -tree get only list of child streams" (using fmt_ccase):
cleartool describe -fmt "%[dstreams]CXp" stream:myStream#\myPVob
The OP neves mentions in the comments having just the names with:
cleartool describe -fmt "%[dstreams]p" stream:myStream#\myPVo

how to list only the name of the baselines and name of the stream from particular component in UCM ClearCase

Is there any way that I can list all baselines' name and stream name for those baselines from a particular component?
The basic command would be cleartool lsbl:
cleartool lsbl -comp aComponent#\aPVob
You can then use fmt_ccase to display the stream as well as the baseline.
cleartool lsbl -fmt "%n %[bl_stream]Xp\n" -comp aComponent#\aPVob
A similar command would be:
cleartool lsbl -tree -comp aComponent#\aPVob
(to see the stream, and its location within the UCM project).
If that doesn't work, you can, for each baseline returned by the first command, do a:
cleartool descr -fmt "%n %[bl_stream]Xp\n" aBaseline#\aPVob

How to clean up unused branch types

I'm trying to reduce access times to ClearCase a bit, and am thinking about removing all the unused branch types (i.e. ones where no element has a branch of that type in the VOB). Is there a simple query that can return unused types, or do I have to scan for instances for each of the existing types?
I prefer something Cleartool or CAL based, as I want to build a tool that can be used by others.
I didn't see any "simple query", so it is best to check for each brtype instance in each vob.
First get the list of brtype for a given vob:
cleartool lstype -s -kind brtype -inVOB
(a bit like in the "Send to mkbranch script")
Then make a cleartool find to check if any version of a given element exists for one specific brtype.
cleartool find /aVobTag -element "brtype(aBrTypeName)"
Note: looking for elements is faster than looking for version here.
If you have the same name of brtype used in multiple branches, the "Additional examples of the cleartool find command" page illustrates:
How to find elements on a specific branch in multiple VOBs:
cleartool find -avobs -element "brtype(branch)" -print

how to find all the branch type created by one person in clearcase

I created a branch type one month ago , but for some reason delayed to use it until now. But now I just have a vague memory of the branch name but not very sure about it
. So I'm wondering if clearcase has the feature that list all the branch type create by a person, in my case just me, then I can find the exact name of the branch type I created one month ago . Need your help, thanks in advance .
You can list the brtype of a vob, displaying only what you need with fmt_ccase directives:
cleartool lstype -kind brtype -invob \myVob
would be enough to do some grep, but for a more compact output:
cleartool lstype -kind brtype -invob \myVob -fmt "%u %Ad %N\n"
You would only have the username, the date and the name of the brtype, for you to grep.
Note the %Ad parameter: age in days, to be able to quickly spot brtype created 30 days or so ago.
cleartool lstype -kind brtype | grep username works for me on Linux.

Resources