Question

One of our team member (located in different region) has shelved changes in P4 with changelist 1234.

Now, if I want to see what files are modified snf what are the changes, how can I do this?

What is the P4 command that I should use to see the changes made by our team member?

Was it helpful?

Solution

p4 describe -S 1234 should to the trick, see the documentation on describe.

To see the file content you would unshelve the files into your workspace (assuming you have a workspace for the same project your colleague is working on).

Create a new (empty) changelist with p4 change (results in e.g. 2345), then use p4 unshelve (docu) to get the modified files to your workspace:

p4 unshelve -s 1234 -c 2345

If you don't want the modified files in your workspace any longer, you can p4 revert -c 2345 them.

OTHER TIPS

Using the GUI, go to Pending and remove all filters except by user, where you will put the other developer's ID. From there you should be able to see her Changelists, including the ones having shelved files. Right click on the Shelved Files icon and select Unshelve. You will have to have a workspace active that includes the files that you are trying to unshelve.

Using UI client, press Ctrl+G. Dialog window is appears. Select Changelist in combobox and input number of changelist.

Let's assume that changelist 123456 is the shelved changelist in question. As a previous answer mentioned, the way to list the files are associated with that changelist is via the p4 describe -s <changelist> command. Like so:

$ p4 describe -s 123456
Change 123456 by john.doe@JohnsBranch on 2013/10/24 15:38:10 *pending*

    [Shelving my changes for Jane.]
    Fix memory corruption caused by uninitialized pointer.

Affected files ...

... //depot/branches/JohnsBranch/kernel/vm/pageutils.c#1 edit

Once you know the file(s) in question, there are a couple of ways to diff the files without a corresponding workspace. Method #1 is to use p4 print:

$ p4 print -q //depot/branches/JohnsBranch/kernel/vm/pageutils.c#1       > /tmp/old
$ p4 print -q //depot/branches/JohnsBranch/kernel/vm/pageutils.c@=123456 > /tmp/new
$ diff /tmp/old /tmp/new    # Or use kdiff3, tkdiff, etc.
          ...
  <diff output here>

The other method is to use p4 diff2:

$ p4 diff2 //depot/branches/JohnsBranch/kernel/vm/pageutils.c#1 //depot/branches/JohnsBranch/kernel/vm/pageutils.c@=123456
          ...
  <diff output here based on Perforce server's diff algorithm>

Both methods can be easily incorporated into the scripting language of choice.

jhwist's solution is good if you want to see the files' diffs.

If you want to see just the shelved files, use p4 describe -sS 1234.

The lower case s restricts the output from including file diffs.

If you wanted to see the actual content of the files, you could use:

p4 print <file>@=<shelved_change>

The @= means to look at the shelved change, where as @ means to look at the change.

In P4V UI, select

Search - > Go To

then choose type of changelist (in your case 'Pending changelist'), enter changelist number and click "OK".

If you want to see only the list of files inside a ChangeList (whether it's a shelve, pending or submitted CL), without extra data, grep the result:

p4 describe -S 12345 | grep -oP '(?=//).*(?=#)'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top