【问题标题】:How to list only the name of the baselines in UCM ClearCase?如何仅列出 UCM ClearCase 中的基线名称?
【发布时间】:2013-10-17 19:00:46
【问题描述】:

如果我这样做:

cleartool lsbl -stream stream:mystream@\mypvob

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

有没有我能做到的?

【问题讨论】:

    标签: clearcase clearcase-ucm cleartool baseline


    【解决方案1】:

    这里有两个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

    【讨论】:

    • 看起来很强大,也适用于一组其他场景
    【解决方案2】:

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

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

    【讨论】:

    • 感谢一百万,救了我的命。
    • 有什么简单的方法可以只获得手动基线而不是自动基线(由 ClearCase 自动生成)?
    • @knm: 是的,将%[label_status]p 添加到-fmt 指令中,并从结果中排除“未标记”:cleartool lsbl -fmt "%n %[label_status]p\n" -stream stream:mystream@\mypvob | grep -vi unlabeled
    猜你喜欢
    • 1970-01-01
    • 2014-12-18
    • 1970-01-01
    • 2011-01-24
    • 1970-01-01
    • 1970-01-01
    • 2015-01-19
    • 2012-03-30
    • 1970-01-01
    相关资源
    最近更新 更多