I need to apply a label on a set of two or more labels that are already created using cleartool. I know how to create and apply a label using cleartool and have studied mklabel command. But couldn't find any provision to apply a label over multiple labels. Can anyone please provide solution for the same??
Asked
Active
Viewed 1,635 times
1 Answers
1
You could try and find all the relevant versions (the ones with the right labels) and perform a mklabel
.
cleartool find can be combined with an exec directive including a mklabel.
cleartool find . -ver "lbtype(LBL1) || lbtype(LBL2)" \
-exec "cleartool mklabel -replace NEW_LBL \"%CLEARCASE_XPN%\"
The tricks though are:
you need to list your labels from the oldest to the newest (here
LBL2
must be created more recently thanLBL1
) because you canmklabel
only one version per file: if a file has two different versions each labeled with one of your label, you want to end up with your new label on the most recent one. Hence the order in the find query.you need the '
-replace
' option of themklabel
, because again, if two versions are found, the firstmklabel
will work, the second won't unless the-replace
instructs it to moveNEW_LBL
to the second version.

Jonathan Leffler
- 730,956
- 141
- 904
- 1,278

VonC
- 1,262,500
- 529
- 4,410
- 5,250