2

If I do:

cleartool lsbl -stream stream:mystream@\mypvob

That will lists the baselines with details.
But I want to list only the name of the baselines.

Is there anyway I can do that?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
user_new
  • 147
  • 1
  • 2
  • 9

2 Answers2

4

Here two examples in python, found on snip2code.com

1) Get the foundation baseline of a stream

import os
working_stream = "myStream"
pvob = "MyVobs"
foundation_bl = os.popen("cleartool descr -fmt \"%[found_bls]CXp\" stream:"
    + working_stream + "@" + pvob).readlines()[0].split(":")[1].split("@")[0]
print "Found Foundation baseline = " + str(foundation_bl)

Link: How To Get The Foundation Baseline

2) Get all baselines of a stream

import os
stream = "myStream@/myVobs"
latest_bl=os.popen("for a in `cleartool lsstream -fmt \"%[latest_bls]p\" " + 
               stream + "`; do echo $a; done").readlines()
print "Latest baseline found = " + str(latest_bl)

Link: How To Get The Baselines From UCM Stream

Dominique Terrs
  • 609
  • 8
  • 5
3

You can use the fmt_ccase options in order to format the result of a cleartool lsbl command.

cleartool lsbl -fmt "%n\n" -stream stream:mystream@\mypvob
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • is there any easy way to get only manual baselines not the auto baseline(auto generated by ClearCase)? – user_new Oct 31 '13 at 05:41
  • @knm: yes, add `%[label_status]p` to the `-fmt` directive, and exclude 'unlabeled' from the result: `cleartool lsbl -fmt "%n %[label_status]p\n" -stream stream:mystream@\mypvob | grep -vi unlabeled` – VonC Oct 31 '13 at 06:30