Cleartool - List Objects with Their Labels

China☆狼群 提交于 2019-12-08 06:49:36

问题


I want to list all objects (including files and directories) recursively with labels their have.
When I run the following command, it writes only Rule. It does not write all labels on any object.

cleartool ls -r -l /view/stable/MYVOB/MyProject

Result :

version /view/stable/MYVOB/Car.java@@/main/3 Rule: element * TO_TEST
version /view/stable/MYVOB/Driver.java@@/main/2 Rule: element * TO_TEST

How can I list the all labels?
In addition, listing modifiers and modification date will be plus for me.

Thanks in advance...


回答1:


You can use a cleartool find, using fmt_ccase options to display the associated labels

Windows Syntax:

cleartool find . -type f -ele "brtype(mybranch)" -exec "cleartool descr -fmt \"%n labels:%l\n\" \"%CLEARCASE_PN%\""

Unix Syntax:

cleartool find . -type f -ele "brtype(mybranch)" -exec 'cleartool descr -fmt "%n labels:%l\n" "$CLEARCASE_PN"'

The idea is to described each element found ($CLEARCASE_PN) by using the %l option of the fmt_ccase directives in order to print labels associated with it.




回答2:


Here is my solution :

cleartool find . -exec 'cleartool descr -fmt "%En@@%Sn|%u|%Fu|%Sd|%l|\n" "$CLEARCASE_PN"' 


来源:https://stackoverflow.com/questions/23539658/cleartool-list-objects-with-their-labels

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