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

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

Related

How to obtain previous baseline from stream

I can retrieve latest baseline which is always recommended in my case using following command
"cleartool desc -fmt \"%[rec_bls]CXp\" stream:".$SourceStream."\#\\".$pvob
I want to retrieve second latest baseline.Is it possible to obtain previous baseline from a given stream using cleartool command? previous applied baseline on any given component will also works.I need this to get difference between two streams from different projects which can be done by following command.
"cleartool diffbl -elements baseline:".$LastComponentBaseline." stream:".$CurrentStream;
You can start by looking at the output of cleartool lsbl: it does list (for a given stream and/or component).
Combined with fmt_ccase, you can grep the recommended baseline you know, and the line before, since lsbl lists baselines from the oldest to the newest
cleartool lsbl -fmt "%[component]Xp %n" -stream aStream#\aVob | grep -B 1 -E "yourComponent.*yourBaseline"
You need to grep for the right component name (displayed by the %[component]Xp format), as lsbl (on a stream) would list all baselines of all components.

Clearcase: List all comments messages in stream

I have read this and run the below command :
cleartool lsact -r -in stream:aStream#\aPVob -fmt "%n %c"
After running this I got :
SOLNSxxxx Created automatically as a result of 'Work on' action in ClearQuest
I didn't get this as I am expecting the comment message against every activity and files checked-in in activity with commit message.
And will this change anything in clearquest too ?
Please let me know.
as I am expecting the comment message against every activity and files checked-in in activity with commit message.
No, that would return the name and comment of the activity only, not of its change set versions.
See "How to find files associated with a ClearCase UCM activity?": for each version return, you would need to apply a cleartool descr -fmt "%n %c"
Try (not tested)
cleartool describe -fmt "%[versions]CQp" activity-title#\aPVob |\
xargs cleartool descr -fmt "%n %c"
If the first describe list all versions on one line, use:
cleartool describe -fmt "%versionsCp\n" activity:<your activity>#<your pVOB> | perl -pe 's/\,\s?/\n/g'
# or
cleartool describe -fmt "%[versions]CQp\n" activity:<your activity>#<your pVOB> | perl -pe 's/\,\s?/\n/g'

How to ask cleartool lsvtree to show the author's name

How to list the ClearCase versions including the author of each change ?
I tried lsvtree -all which doesn't give me this information.
Check the different options available with fmt_ccase, include "%n %u": %u is for user.
The doc mentions:
Note: In commands that output data on multiple versions, such as lshistory and lsvtree, formatting is applied to each version, not to the command output as a whole.
However, since lsvtree doesn't support fmt, you can fallback to lshistory:
cleartool lshistory -fmt "%n %u\n" afile

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 filter the baselines(UCM) alone from describe command?

As we are having many components , I am trying to describe all the baselines using following command
cleartool describe -l baseline:Baseline_2.1.0.13#\My_PVOB
It provides output like follows
"Build 13"
master replica: My_PVOB#\My_PVOB
owner: Admin
group: ABC
stream:Components_Integration#\My_PVOB
component: Baselines#\My_PVOB
label status: No Versions to Label
change sets:
promotion level: INITIAL
depends on:
Baseline_2.1.0.13.8206#\My_PVOB (Comp1#\My_PVOB)
Baseline_2.1.0.13.433#\My_PVOB (Comp2#\My_PVOB)
Baseline_2.1.0.13.423#\My_PVOB (Comp3#\My_PVOB)
Baseline_2.1.0.13.3763#\My_PVOB (Comp4#\My_PVOB)
Actually i want to get contents only below depends on: ( Want to get Just following contents)
Baseline_2.1.0.13.8206#\My_PVOB (Comp1#\My_PVOB)
Baseline_2.1.0.13.433#\My_PVOB (Comp2#\My_PVOB)
Baseline_2.1.0.13.423#\My_PVOB (Comp3#\My_PVOB)
Baseline_2.1.0.13.3763#\My_PVOB (Comp4#\My_PVOB)
How to omit the remaining information?
From the fmt_ccase man page:
%[depends_on]Cp
(UCM baselines) The baselines that the composite baseline directly depends on
So for a composite baseline:
cleartool descr -fmt "%[depends_on]Cp" baseline:aBaseline#\apvob
could do the trick, except it will print only the dependent baselines on one line, each name separated by space, and without their associated component name.
So you need to parse that output, and for each baseline name, do a:
cleartool descr -fmt "%[component]Xp" baseline:aBaseline#\apvob
(Or, if your naming convention for baselines allows for it, a simple:
cleartool describe -l baseline:Baseline_2.1.0.13#\My_PVOB | grep Baseline_
would be easier!)
Actually, the OP samselvaprabu took the last proposition to grep what he needed from the initial output. His grep is better than my proposal, because it doesn't depend on the Baseline naming convention, but on the PVob name of said baselines:
I am using windows so your last(simple) command gave me the idea.
Following command works in Dos
cleartool describe -l baseline:Baseline_2.1.0.13#\My_PVOB | find "#\My_PVOB)"
Read "fmt_ccase" manual, you'll find it over there:
cleartool man fmt_ccase

Resources