我没有找到一种方法describe
在复合基线和它的成员基线之间传递这两者。
我的解决方案(不令人满意)是在 bash 中(通过 msyswwin 在 Windows 上可用,使用 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"}'
我使用fmt
我需要的任何东西(这里只是与成员基线关联的组件的名称及其名称)
然后我执行每个输出行以获得' afile
'中的最终结果。
您的 PowerShell 脚本方法当然更好。
实际上,OP Samselvaprabu确认了以下 PowerShell 方法:
$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
}