How to filter the baselines(UCM) alone from describe command?

笑着哭i 提交于 2019-12-24 00:30:09

问题


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?


回答1:


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)" 



回答2:


Read "fmt_ccase" manual, you'll find it over there:

cleartool man fmt_ccase


来源:https://stackoverflow.com/questions/8571421/how-to-filter-the-baselinesucm-alone-from-describe-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!