Shelved files persist in the depot until they are discarded (by means of p4 shelve -d ) or replaced by subsequent p4 shelve commands. p4 shelve displays the working revision for the files being shelved. In addition to the files being shelved, p4 shelve also shelves any open stream specification.
Shelving in Perforce allows users to store and share file snapshots on the central server. This can be useful for allowing others to review your work, moving your progress to another workspace, validating builds on multiple platforms, and preserving your work so that you can work on another project.
You need to re-open d. txt and give it that change number using p4 reopen -c <change#> d. txt . Then run p4 shelve -r to update the shelved files.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With