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

烈酒焚心 提交于 2019-12-13 12:12:24

问题


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?


回答1:


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



回答2:


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



来源:https://stackoverflow.com/questions/19288635/how-to-list-only-the-name-of-the-baselines-in-ucm-clearcase

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