cleartool: How to list all labels in a stream chronologically?

孤人 提交于 2020-01-11 06:16:14

问题


I want to list all the labels applied to a stream in a chronological order. Ideally, I would like one like the following for each label:

 <label> <timestamp> <userid>

I looked at few questions. The command

 ct lstype -kind lbtype -invob . -short

from the question "Clearcase: List labels matching a particular string" appeared promising, but it lists the labels that were applied in the ancestor streams. I do not want that, I want only the labels that are applied to the current stream.

I feel that there must be some way, but unfortunately I could not find out. If you have suggestions, I can try it out.


回答1:


If you are mentioning Stream, that means ClearCase UCM, which includes UCM Baselines.

You need to reason with baselines, not labels: a baseline can be an incremental one, which means you won't find a label for all elements of a given component.
(See "What is the difference between Full baseline and Incremental baseline in Clearcase UCM?" for more).
Lbtypes and labels are attached ("guarded") to baselines (through an hyperlink), but the actual object (associated with a userId and a date) are baselines.

cleartool lsbl -stream aStream@\aPVob

That will list all the baselines, from the oldest to the newest, applied on a given stream.
(see cleartool man lsbl)

As commented by danger89, cleartool lsbl -s -stream aStream@\aPVob would display a short version per line.


danger89 adds in the comments:

To get a nice table output use:

(printf "Baseline|Label Status|Promotion Level|Owner|Predecessor baseline\n" \ ; cleartool lsbl -lev BUILT -fmt "%n|%[label_status]p|%[plevel]p|%[owner]p|%[predecessor]p\n" ) | column -t -s '|'

In multiple lines for readability:

(printf "Baseline|Label Status|Promotion Level|Owner|Predecessor baseline\n" \ ; 
 cleartool lsbl -lev BUILT -fmt "%n|%[label_status]p|%[plevel]p|%[owner]p|%[predecessor]p\n" )
   | column -t -s '|'


来源:https://stackoverflow.com/questions/13035841/cleartool-how-to-list-all-labels-in-a-stream-chronologically

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