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

前端 未结 3 1288
渐次进展
渐次进展 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:34

    The doco is really clear about what is being labelled, in fact the first example shown in doco states that exactly...current view objects are labelled by default & currently selected versions (i.e. if in your view then label it, else not.)

    ....extract below from doco below (note: context and command and that label-type-selector pname is the last parameter...left blank below because resident in working dir)...

    Example: •Create a label type named REL6. 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. cmd-context> mklbtype –nc REL6

    Regards

    Jim2

    0 讨论(0)
  • 2021-01-02 11:51
    cleartool mklabel  -r(ecurse) LABEL_NAME <directory name>
    

    This command will apply LABEL_NAME to all files in folder and below of your view, you can just go to that directory,then type following command to create and apply label

    > cd /vob/test/a
    > cleartool mklbtype –nc TEST_LABEL 
    > cleartool mklabel  -r TEST_LABEL .
    
    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题