tags:

views:

133

answers:

3

In Perforce, how do I list all changesets for a given user? Can that be done via a single "p4" command?

+5  A: 

Yes.

p4 changes -u <username>
Aaron F.
A: 

p4 changes -m 1 -L -t -u

felickz
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