Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing a change in a shelved perforce file

Tags:

perforce

If a colleague has a file shelved in perforce, and I'd like to diff the file in the shelved changelist against the source version of that file what is the perforce command needed to do this?

For example if the file a.txt is shelved in changelist 156222 how do I view the changes to a.txt that are in the shelved changelist vs. the current review of a.txt

like image 484
Lee Avatar asked Feb 16 '12 10:02

Lee


2 Answers

If you know the revision of the shelved file (e.g. #4) and the head revision (#3 in this case) you can use

p4 diff2 //path/to/depot/file#3 //path/to/depot/file@=<changenumber>

or - even easier - you can use p4 describe (see manual):

p4 describe -S <changenumber>

Find the changenumber with:

p4 changes -u <user> -s shelved
like image 140
jhwist Avatar answered Jan 02 '23 19:01

jhwist


If you are using P4V, you can go to your Pending tab and select the "User" and "Workspace" of your colleague (with the help of the drop-down "Browse..." option).

Then you will see his/her Pending lists, being it composed of shelved files or not. From there, the normal "Diff Against" will work for the "a.txt" file.

like image 45
Flávio Ivan Avatar answered Jan 02 '23 19:01

Flávio Ivan