问题
I am trying to get a list of all revisions on all files within a directory with this information:
- The version number
- Changelist number
- Developer's id.
I tried using P4 files: p4 files -a . > output.txt, but this command has no options to give me the developer's id & changelist number.
回答1:
My request for clarification notwithstanding, as I understand your question I think you want to use p4 filelog
:
p4 -c <client-name> filelog ... > output.txt
This will produce lines like:
//path/to/depot/file
... #15 change 384363 edit on 2011/04/06 by user.name@c-user.name-client (text) 'comment'
... #14 change 381364 edit on 2011/03/21 by user.name@c-user.name-client (text) 'comment'
... #13 change 375094 edit on 2011/02/16 by user.name@c-user.name-client (text) 'comment'
... #12 change 374246 edit on 2011/02/11 by user.name@c-user.name-client (text) 'comment'
... #11 change 374042 edit on 2011/02/11 by henrik.wist@c-henrik.wist-client (text) 'comment
... #10 change 373886 edit on 2011/02/10 by henrik.wist@c-henrik.wist-client (text) 'comment'
... #9 change 373567 edit on 2011/02/09 by max.ritter@c-max.ritter-all (text) 'comment'
... #8 change 373553 edit on 2011/02/09 by user.name@c-user.name-client (text) 'comment'
... #7 change 373350 edit on 2011/02/09 by user.name@c-user.name-client (text) 'comment'
... #6 change 370568 edit on 2011/01/25 by user.name@c-user.name-client (text) 'comment'
... #5 change 368223 edit on 2011/01/14 by user.name@c-user.name-client (text) 'comment'
... #4 change 365805 edit on 2010/12/21 by user.name@c-user.name-client (text) 'comment'
... #3 change 364494 edit on 2010/12/14 by henrik.wist@c-henrik.wist-client (text) 'comment'
... #2 change 362107 edit on 2010/12/02 by user.name@c-user.name-client (text) 'comment'
... #1 change 359972 add on 2010/11/23 by user.name@c-user.name-client (text) 'comment'
for each file. If you only need the latest change, use
`p4 -c <client-name> filelog -m 1 ... > output.txt
回答2:
I don't have a Perforce console near me, but what about
p4 changes ...
for the current directory on down, or
p4 changes dir_name/...
for a general directory.
I believe it has the info you want.
回答3:
There is no command that will give you filename, revision and user. Unfortunately you can only get 2 out of 3. I think your best bet is to write a script that uses p4 fstat
and then does a p4 describe
on the changelist numbers to get the user names.
回答4:
Consider using P4Report to construct this kind of compound query. With a fairly simple bit of SQL, you can extract the most volatile files, and you could combine with a query that shows the most active users. I think one of standard reports it installs is for volatile files. But its not hard to work it out for yourself anyway.
The link above is to the documentation - the sample queries in that show how easy it is to use. It's free.
来源:https://stackoverflow.com/questions/5581655/how-do-i-list-all-files-revisions-changelist-number-developers-id-within-a-d