How to view Shelved P4 Changes?

How to view Shelved P4 Changes?

up vote19down votefavorite

6

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

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

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

thanks

share|improve this question

        asked Oct 13 '11 at 17:43

Mike
1,04453458

 

 

 

 

4 Answers                                4

activeoldestvotes

 

up vote25down voteaccepted

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.

share|improve this answer

edited Oct 14 '11 at 7:45

 


 

        answered Oct 13 '11 at 18:23

jhwist
5,49012438

 

 

 

Thanks! And if I want to download those files (which have shelved changes in my P4 workspace, what would be the command?–                     MikeOct 14 '11 at 1:58

1

 

You could just use P4V for that–                     cristobalitoOct 14 '11 at 7:29

1

 

Thanks for the helpful answer. Quite annoying that a new argument is necessary to view shelved changes. </rant>–                     Matt MendellJul 21 '12 at 21:08

 

 

When I enter p4 revert -c 2345 I get Missing/wrong number of arguments. The "files" argument is mandatory, although I would expect it to default to all the files in the changelist.–                     danortonFeb 6 '13 at 17:51

 

up vote12down vote

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.

share|improve this answer

        answered Jun 11 '13 at 20:40

Matthew White
12112

 

7

 

It is actually easier to hit Ctrl-G and enter the changelist number–                     ModdyFireJan 14 at 3:39

 

up vote1down vote

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 123456Change 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.

share|improve this answer

        answered Oct 25 '13 at 1:07

troydj
744

 

 

 

 

up vote0down vote

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 '(?=//).*(?=#)'

share|improve this answer

        answered Sep 25 '13 at 9:29

 


 

            community wiki       

        Noam Manos

 

http://stackoverflow.com/questions/7758173/how-to-view-shelved-p4-changes

你可能感兴趣的:(How to view Shelved P4 Changes?)