How to list only the name of the baselines in UCM ClearCase?

不羁的心 提交于 2019-12-04 16:37:04

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

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

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