Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Perforce, list all changesets by user

Tags:

perforce

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

like image 555
Aaron Fi Avatar asked Apr 21 '10 01:04

Aaron Fi


People also ask

How do I view files in changelist?

To display shelved changelists, use p4 changes -s shelved , and then use p4 describe -s -S changelist to display the files in the selected changelist(s).

What is a changelist in Perforce?

When you check out a file, Perforce adds information about the file to a changelist and changes the writable attribute of the file in your local workspace from read-only to read/write. A changelist defines a logical grouping of work across a set of files and folders.

What does p4 Fstat do?

The p4 fstat command dumps information about each file, with information for each field on a separate line. The output is best used within a Helix C/C++ API application where the items can be accessed as variables, but is also suitable for parsing by scripts.

How do I run a P4V command?

Quick start with p4Open p4v (visual Perforce client). Right click on the project folder. Click "Open Terminal". Now you can use p4 in a preconfigured console, you don't need to setup workspace and server connection.


2 Answers

Yes.

p4 changes -u <username>
like image 130
Aaron Fi Avatar answered Nov 17 '22 04:11

Aaron Fi


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] }
like image 38
tenpn Avatar answered Nov 17 '22 04:11

tenpn