如何仅列出UCM ClearCase中基线的名称?

时间:2013-10-10 06:31:17

标签: clearcase clearcase-ucm cleartool baseline

如果我这样做:

cleartool lsbl -stream stream:mystream@\mypvob

这将列出具有详细信息的基线 但我想只列出基线的名称。

无论如何我能做到吗?

2 个答案:

答案 0 :(得分:4)

这里有两个python示例,位于snip2code.com

1)获取流的基础基线

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)

链接:How To Get The Foundation Baseline

2)获取流的所有基线

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)

链接:How To Get The Baselines From UCM Stream

答案 1 :(得分:2)

您可以使用fmt_ccase options格式化cleartool lsbl command的结果。

cleartool lsbl -fmt "%n\n" -stream stream:mystream@\mypvob