2

I am trying to find all the components baselines associated in a composite baseline.

I am able to achieve it using following way

cleartool desc -fmt %[rec_bls]CXp stream:My_Integration@\My_PVOB

(I would save the receommended baselines in some variable using powershell and replace it in next command) 

cleartool describe -l baseline:"$Baseline"@\My_PVOB

Is it possible to combine both command so that i can describe all the recommended baselines.

In the above approach i am forced to use some script to save baselines then to use it in Cleartool command. If it can be combined in cleartool itself it will be good and handy.

Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230

1 Answers1

1

I didn4t find a way to pipe the two describe between the composite baseline and its member baselines.

My solution (which isn't satisfactory) is, in a bash (available on Windows through msyswwin, with a tool like msysgit):

$ ct descr -l baseline:P_Summit_HUB_12_30_2011@\\Summit_HUB_pvob |grep "b)"|awk '{print "cleartool descr -fmt \"%[component]Xp %n\\n\" baseline:" $1 " >> afile"}'

I use whatever fmt I need (here just the name of the component associated with the member baseline and its name)

Then I execute each output line in order to get the final result in 'afile'.

Your PowerShell script approach is certainly better.


Actually, the OP Samselvaprabu confirms following said PowerShell approach:

$Baselinefile="C:\Baseline.txt" 
$project="MyComponents@\My_PVOB" 
$pvob="@\My_PVOB" 

# Find the list of Recommended baseline for the project 
$Baselines=(cleartool lsproject -fmt "%[rec_bls]p" $project).split() 

#Foreach baseline get the baseline and Component Name 
foreach ($Bline in $Baselines) { 
  cleartool describe -l baseline:"$Bline"$pvob | Select-string -pattern "@\\My_PVOB)"| Out-File $BaselineFile -append 
}
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Ok. I am using following powershell to tackle the issue. "$Baselinefile="C:\Baseline.txt" $project="MyComponents@\My_PVOB" $pvob="@\My_PVOB" # Find the list of Recommended baseline for the project $Baselines=(cleartool lsproject -fmt "%[rec_bls]p" $project).split() #Foreach baseline get the baseline and Component Name foreach ($Bline in $Baselines) { cleartool describe -l baseline:"$Bline"$pvob | Select-string -pattern "@\\My_PVOB\)"| Out-File $BaselineFile -append } " Hope it may help others in future – Samselvaprabu Jan 10 '12 at 07:04
  • @Samselvaprabu: Interesting feedback, thank you. I have included your script in my answer for more visibility. – VonC Jan 10 '12 at 07:35
  • @VonC : In your command pipe ... |grep "b)"|... is this correct? What is the significance? – Jayan May 28 '14 at 17:33
  • 1
    @jayan I suspect (3 years later) that I was after lines which contained "b)", probably because it hab "vob)" in it ( I cannot test it right now) – VonC May 28 '14 at 17:51