Search code examples
clearcase

How to add attribute to every file in VOB at element (not version) level


I'm trying to add an attribute to the element for every file in a given VOB, and I can't find the syntax to avoid having the attribute added to the version instead of the element.

Here's what I'm trying:

cleartool find . -exec "cleartool mkattr Exception \\\"NEW_VAL\\\" \"%CLEARCASE_PN%\""

I always get output to the effect of

Created attribute "Exception" on ".\bigrdj6000\bigrdj6000.fmb@@\main\4".

I've tried lots of combinations of -nxn, -all and -element on the find command, but I just can't seem to get rid of the @@\main\4

Can somebody please put me out of my misery?


Solution

  • Try:

    cleartool find . -exec "cleartool mkattr Exception \\\"NEW_VAL\\\" \"%CLEARCASE_PN%@@\""
                                                                                       ^^
                                                                                        |
                                                      (final '@@' to reference an element)
    

    The problem is that \"%CLEARCASE_PN%\" represents a file within a view, meaning the version of that file as selected by the config spec of that view.

    However, \"%CLEARCASE_PN%@@\" should represent the element of that file.

    This is compliant with the mkattr man page:

    cmd-context mkattr RESPONSIBLE \"Anne\" hello.c@@
    Created attribute "RESPONSIBLE" on "hello.c@@".