Showing a change in a shelved perforce file

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

Best Answer

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
Related Topic