nowox
nowox

Reputation: 29096

ClearCase: how to list the attributes attached to a branch

With the following, I can attach an attribute to a branch:

cleartool mkattr islocked \"true\" brtype:MY_BRANCH_NAME

How can I verify the value of this attribute?

As advised by VonC, I specified the VOB name in my command:

First let ensure the attribute exist and has been registered:

$ ct mkattype -replace -nc -enum \"true\",\"false\" -default \"false\" islocked
Replaced definition of attribute type "islocked".

-

$ ct mkattr -replace islocked \"true\" brtype:MY_BRANCH_NAME@\\myVOB
Created attribute "islocked" on "MY_BRANCH_NAME".

Then we can ask for the attribute's value:

$ ct desc -l brtype:MY_BRANCH_NAME@\\myVOB
branch type "MY_BRANCH_NAME"
  created 2016-02-22T13:16:51Z by Nowox
  master replica: cpAdmin@\myVOB
  request for mastership: allowed for branch type
  request for mastership: allowed for all instances
  owner: user
  group: group
  scope: global
  constraint: one version per element
  Hyperlinks:
    GlobalDefinition@78418@\myVOB <- brtype:MY_BRANCH_NAME@\myVOB

Unfortunately I don't see my attribute...

Same issue with this one:

$ ct desc -l -aattr islocked brtype:MY_BRANCH_NAME@\\myVOB
MY_BRANCH_NAME

Upvotes: 1

Views: 1225

Answers (2)

iclman
iclman

Reputation: 1436

I have noticed similar issues on my side with the "cleartool desc" command. You can use the "cleartool dump" command in order to see the value of the attribute.

cleartool dump -l brtype:YOUR-BRANCH@/YOUR-VOB

Upvotes: 1

VonC
VonC

Reputation: 1324537

cleartool describe can help:

cleartool desc -aattr myattribute brtype:MY_BRANCH_NAME

fmt_ccase has also an option to display the value:

clearcase desc -fmt "%Sa" brtype:MY_BRANCH_NAME

As Brian Cowan mentions in the comment, a cleartool descr -l can help ascertain if there is an attribute set and what its value is.
Compare that output with a cleartool descr -l -local to see if the attribute differs, and if the object is a local instance of a global type.

If the attribute has been define in an AdminPVob, check its type (global or local).

Upvotes: 1

Related Questions