1

I'm wondering if there is a way to specify which streams to get a list of activitis for in one command line call?

Right now I'm building a list of activities based on either a vob or an individual stream, using either:

ct lsact -invob vob_name

or

ct lsact -in stream:stream_name

However, now I'm trying to filter it a little bit to remove activities from streams that are on locked/obsolete projects. I've got the list of streams that are on unlocked projects already, but I don't know of any way to pass this in to "cleartool lsact".

Running "ct lsact -invob", then filtering the output takes too long (upwards of 30 seconds to get output from cleartool), so I am hoping there is some way I can pass in the streams to a ct lsact or ct describe command, or something else, to do the filtering in the command instead of after.

Any ideas?

ChrisC
  • 1,161
  • 12
  • 26

2 Answers2

1

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
Ian W
  • 4,559
  • 2
  • 18
  • 37
0

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
)
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I'm actually doing this from a Windows Forms GUI, but I guess if I need to do it I can just kick the batch file from there. However, this still takes just as long (if not longer) than doing the -invob version as it has to process lots of individual requests. By the way, "lsact in" should be "lsact -in", but it wouldn't allow me to edit such a small change myself! Thanks again! – ChrisC Mar 21 '14 at 17:17