Request labels with a specific attribute in ClearCase

How can I query those labels in ClearCase with cleartool that have a specific attribute.

I can list the labels with

lstype -kind lbtype

      

but I would only like to get those that have the TestAttr attribute.

+2


a source to share


1 answer


You can

  • first find the whole version with a specific attribute
  • then describe those versions to map their respective branch

(unix syntax)

cleartool find . -version 'attype(an_attribute_name)' \
  -exec 'cleartool descr -fmt "%Sn" "$CLEARCASE_XPN" '

      

You still need to parse the result to check out the branch, and the sort -u

result.




OP's comments:

I would like to request labels, not files. I have no files with this attribute

Then find

is the wrong command.

The best you can do is list all labels in a given VOB and describe them to display their attribute (if any)

ct lstype -kind lbtype -invob vob:/avob -fmt "%n ~ %[an_attribute_name]a"

      

Only lines with some value displayed after " ~

" should be considered (an arbitrary delimiter just placed here to easily distinguish the label name from its attribute value).
A label without an attribute (at least not the < an_attribute_name

' attribute ) will only display its name followed by " ~

", without any other data after " ~

".

+1


a source







All Articles