How to find the username who created latest versio

2019-05-22 13:01发布

问题:

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.