Cleartool: How to apply label to files which are in my current view only?

前端 未结 3 1300
渐次进展
渐次进展 2021-01-02 11:10

I could not find the proper command to apply a label to files which are in my current view. I have tried the following command:

cleartool mklabel -r TEST_LAB         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-02 11:59

    The mklabel documentation state states, as to what version is labeled:

    Processes the entire subtree of each pname that is a directory element (including pname itself). VOB symbolic links are not traversed during the recursive descent into the subtree.

    One example mentions:

    Attach that label to the version of the current directory selected by your view, and to the currently selected version of each element in and below the current directory.


    Now, if you want to be really sure of the versions actually labelled, one solution is to use a find command, combined with your mklabel:

    cleartool find . -cview -exec "cleartool mklabel TEST_LABEL \"%CLEARCASE_XPN%\""
    

    If you had already that label applied to incorrect version and want to move it:

    cleartool find . -cview -exec "cleartool mklabel -replace TEST_LABEL \"%CLEARCASE_XPN%\""
    

    That way, you can first list the versions involved:

    cleartool find . -cview -print
    

    And then, if you agree with the output, apply the mklabel through the -exec directive.

    The OP user1096966 reports making it work with a cleartool ls, to be sure to select only element visible in the current view:

    cleartool ls -r -vis
    

    The is no '-exec' directive, so a pipe might be involved, as in (not tested, but you get the idea):

    cleartool ls -r -vis -s -nxn | xargs cleartool mklabel -replace TEST_LABEL
    

提交回复
热议问题