tags:

views:

104

answers:

2

Is there any easy way to exclude a specific changelist from p4 sync?

I want to sync up my code, but I don't want to fetch the changes from changelist #1337

Like: p4 sync //depot/source/... - //depot/source/...#1337?

A: 

It is possible by syncing to a range and using two commands to "skip" the changelist.

p4 sync //depot/source/... - //depot/source/...@0,@1337
p4 sync //depot/source/... - //depot/source/...@1337,#head

Note: you may have to specify the changelist on either side of the one you want to skip - not sure if the range is inclusive.

HTH,

Dennis

Dennis Roche
The problem with this method is if a file modified by changelist 1337 is also modified by a subsequent changelist, that file will end up with changes in CL 1337 anyway.
Heath
@Heath: I agree. It is not ideal. I do not understand why the OP wants to exclude a specific changelist - the best way to handle this is to sync to #head and the backout the changelist, then either manually handle future resolves or submit the changes. However if for some reason you are unable to submit, then create a branch and perform the backout of changelist there.
Dennis Roche
A: 

The best way to accomplish this is just sync to head, and then use the 'Back out submitted changelist' function in P4V ('Submitted' pane, right-click the undesired changelist, select 'Back out submitted changelist').

This will create a new pending changelist in your workspace with the undesired changes removed.

Heath
Caveat: files modified by the undesired changelist will now be at the revision preceding the undesired changelist, and any subsequent changes to those files will also be gone. But you can then do an interactive resolve and manually pull in any new changes that you need.
Heath