clearcase - apply label over multiple labels

假装没事ソ 提交于 2019-12-02 04:12:16
VonC

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.

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