Find version and delete it with Cleartool

牧云@^-^@ 提交于 2020-01-11 10:58:47

问题


I'm trying to recursively delete some versions/files from a specific branch.

find delivers the right files. Now it would be up to rmver to remove the version but this gives me an error. I'm struggling with the syntax.

cleartool> find Component\Test -element "brtype(P_Testing_device)" -exec "rmver -f \"%CLEARCASE_PN%@@\main\G_Testing_device\P_Testing_device\LATEST\""
cleartool: Error: Extra arguments: "%CLEARCASE_PN%@@\main\G_Testing_device\P_Testing_device\LATEST\"

What's wrong with that? How would you recursively delete versions from a Branch?


回答1:


First don't if you can avoid it. rmver, as I explain in "How do I undo a checkin in ClearCase remote client", is very dangerous.
If you have hyperlinks attached to the versions you are removing (definitively from ClearCase), like merge links (deliver or rebase links of your are using UCM), you risk ending up with many "dangling hyperlinks", which is not good.

Second, I would try first:

find Component\Test -element "brtype(P_Testing_device)" -exec 'rmver -f "%CLEARCASE_PN%@@\main\G_Testing_device\P_Testing_device\LATEST"'

To rule yout any issue with weak vs. strong quoting (as in "CLEARCASE_XPN not parsed as variable in clearcase command")

If that doesn't work, I would recommend finding all the right versions and putting them into a file, then piping the content of that file to a cleartool rmver.


A much safer route is to cleartool lock -obs the branch, making it non-modifiable and invisible for the future version trees.



来源:https://stackoverflow.com/questions/11794839/find-version-and-delete-it-with-cleartool

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