In Perforce, how do I list all changesets for a given user? Can that be done via a single "p4" command?
A:
In Powershell 2.0:
p4 users
| select-string "^\w+(.\w+)?" | %{$_.Matches} | %{$_.Value}
| %{p4 changes -u $_}
The first line shows all users, the second line parses out the username from the output, adn the third line sends that input to p4 changes
.
EDIT: The regex assumes your usernames are either a single word or a firstname.lastname format. You may need to edit it for different formats.
EDIT2: Ooooh for a given user. Arse.
EDIT3: Shorter powershell:
p4 users
| select-string "^\w+(.\w+)?" | %{$_.Matches}
| %{p4 changes -u $_.Value }
EDIT4: even shorter powershell:
p4 users | % { p4 changes -u $_.Split()[0] }
tenpn
2010-07-01 08:25:32