Phil for Humanity Phil for Humanity
A Guide for the Survival of Humankind and Helping the World, Society, and Yourself.



ClearCase Support: How to Make a ClearCase Label


You may be asking yourself how to create a label in ClearCase from the command line. Here's how!


First, create a label name (this is called a label type) in the VOB that you want to make the label in:

$ cleartool mklbtype TEST_LABEL
Comments for "TEST_LABEL":
.
Created label type "TEST_LABEL".

Don't forget to enter a comment for the label type, or you can use the "-nc" argument for no comment.


Now, you are ready to apply this label to version in ClearCase. To apply it to a single file, use this command:

$ cleartool mklabel TEST_LABEL filename.txt
Created label "TEST_LABEL" on "filename.txt" version "/main/179".

This command will label the version that your config spec is pointing to. To specify a specific version and move the label existing label, use this command:

$ cleartool mklabel -replace TEST_LABEL filename.txt@@/main/99
Moved label "TEST_LABEL" on "filename.txt" from version "/main/179" to version "/main/99".

Finally, if you wanted to label all the files and directories recursively starting from a certain directory, use this command:

$ cleartool mklabel -r TEST_LABEL /vob/test/a
Created label "TEST_LABEL" on "/vob/test/a" version "/main/2".
Created label "TEST_LABEL" on "/vob/test/a/b.txt" version "/main/1".
Created label "TEST_LABEL" on "/vob/test/a/c" version "/main/3".
Created label "TEST_LABEL" on "/vob/test/a/c/d.txt" version "/main/1".

If you want to make sure no one deletes or moves the label or deletes any versions labeled, you may lock the label using this command:

$ cleartool lock lbtype:TEST_LABEL


by Phil for Humanity
on 20070802

Related Articles
 » ClearCase Support: How to Make a ClearCase Branch
 » ClearCase Support: How to Lock a Label
 » ClearCase Support: Another Common ClearCase Labeling Error Message