How to find the username who created latest version of element in clearcase?

依然范特西╮ 提交于 2019-12-07 23:46:10

问题


I am often getting a request like this. " Find the list of files changed from particular day".

I got answer to this as example given below

 "cleartool find <Vobtag> -version "{brtype(IntegrationStream) && created_since(13-Jan.8:30)}" -print"

But few people are asking "Find the list of files changed and by whom". So that they can pin down the developer name and assign him the task to resolve issues.

Is it possible to pipeline the above command and find the user who made that version also?


回答1:


You should be able to add to your find query a created_by member.
See the query language man page.

created_by (login-name)

In all cases, TRUE if the object was created by the user login-name (as shown by the describe command).

So your query would look like:

cleartool find <Vobtag> -version "{brtype(IntegrationStream) && created_since(13-Jan.8:30) && created_by(aUser)}" -print

The OP comments:

The command you have given will find the list of files created by particular person.
But I would like to find all the files created_since and also by whom it was created

True, for that you need to add a format parameter to your query, following the fmt_ccase man page.
Since cleartool find has no -fmt parameter, what you do is to pipe the result of the find query to a cleartool describe command (which can use a -fmt directive).

cleartool find <Vobtag> -version "{brtype(IntegrationStream) && created_since(13-Jan.8:30)}" -exec "cleartool describe -fmt \"%Xn : %u\n\" \"%CLEARCASE_XPN%\"

The second part of the command is:

-exec "cleartool describe -fmt \"%Xn : %u\n\" \"%CLEARCASE_XPN%\"

The important parameters are:

%u

User/group information associated with the object's creation event (modifiers: F, G, L); see also %[owner]p and %[group]p.

\"%CLEARCASE_XPN%\"

It represents the extended pathname of a version found by the find query.



来源:https://stackoverflow.com/questions/8909170/how-to-find-the-username-who-created-latest-version-of-element-in-clearcase

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