How to remove label of a directory and all its contents in clear case?

ajay bidari picture ajay bidari · Aug 31, 2012 · Viewed 14.5k times · Source

I have applied a label to directory in clear case recursively. How can I remove all those labels?

Answer

VonC picture VonC · Aug 31, 2012

The simplest approach would be in command line, using cleartool rmlabel

 cleartool rmlabel -rec YOUR_LABEL yourDirectory

Note: this is for ClearCase V7.1+ only, not CC7.0.x or CCV6.x, and not for CCRC (ClearCase Remote Client)

With older ClearCase versions, you had to do (see technote swg21126736):

# Unix syntax
cleartool find yourDirectory -version "lbtype(YOUR_LABEL)" -exec 'cleartool rmlabel YOUR_LABEL"$CLEARCASE_XPN"'

# Windows syntax
cleartool find yourDirectory -version "lbtype(YOUR_LABEL)" -exec "cleartool rmlabel YOUR_LABEL\"%CLEARCASE_XPN%\""

Note: you could remove a label using a GUI, but as described in technote swg21146450, this is a file-by-file operation only!

version tree with label Remove label

(Not very practical if you have hundreds of elements -- files and directories -- to process...)