2

我正在尝试查找复合基线中关联的所有组件基线。

我可以使用以下方式实现它

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

是否可以将这两个命令结合起来,以便我可以描述所有推荐的基线。

在上述方法中,我被迫使用一些脚本来保存基线,然后在 Cleartool 命令中使用它。如果它可以结合到 cleartool 本身中,那将是很好的和方便的。

4

1 回答 1

1

我没有找到一种方法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 
}
于 2012-01-06T13:07:50.027 回答