clearcase - apply label over multiple labels

那年仲夏 提交于 2019-12-20 04:24:31

问题


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??


回答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 than LBL1) because you can mklabel 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 the mklabel, because again, if two versions are found, the first mklabel will work, the second won't unless the -replace instructs it to move NEW_LBL to the second version.



来源:https://stackoverflow.com/questions/4507681/clearcase-apply-label-over-multiple-labels

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!