How to list ClearCase activities in certain streams?

妖精的绣舞 提交于 2019-12-01 12:01:45

Doesn't it always seem you can never quite get ClearCase to tell you what you want to know in the form you want?

An alternative may be to use the -fmt option

ct lsact -fmt "%[stream]Xp %n\n" -inv /vobs/my_pvob

You can then pipe through grep (-v) or other filter tool to exclude/get the projects of interest. Since it's not possible to list activities only for active streams, the alternative would be to also lock your activities when you lock the project/stream, then obsolete activities would be excluded (use -obsolete to list all activities).

Or, building on VonC suggestion, process the active streams (no -obs switch) - without the need to store the list (unix):

for stream in $(ct lsstream "%Xn" -inv /vobs/my_pvob); do
   echo ::: ${stream}
   ct lsact -in ${stream}
done
VonC

If you are talking about bash script, you can easily store the list of streams in a variable:

s=$(ct lsstream -s -invob /vobs/aPVob)

You can then iterate on each line within $s:

while read -r line; do
    echo "... $line ..."
done <<< "$list"

In a DOS script, I would recommend writing those streams to a file first, and then process each line.

cleartool lsstream -s -invob /vobs/aPVob > %TMP%\s.txt

for /F "tokens=*" %%A in (myfile.txt) do (
  cleartool lsact in stream:%%A@\aPVob
)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!