How can I limit the Perforce synchronization operation to only those files in a specific change list?

I thought I could use P4 sync -f @Changelist # to synchronize only those files in Changelist #, but this is the synchronization of the entire directory. How to limit synchronization only to files in Changelist #?

+7
source share
4 answers

To synchronize only the files contained in the change list, you can use the syntax @= :

 p4 sync @=12345 
+7
source

If you want to restrict synchronization to only files in a specific change list, you can do the following:

 $> p4 sync @changelist,@changelist 

eg.

 $> p4 sync @604286,@604286 
+6
source

If I understand the question correctly, you already have a tree with some files. Now there is a new changelist and you want your tree to be updated so that only the files listed in this new changelist are synchronized, leaving the rest of the tree intact / unaffected.

If so, then the answer will be - p4 sync @ = changelist. But just to be safe, first try with the p4 sync -n @ = changelist option.

If you try using p4 sync @changelist, you will see that your entire tree is updated / deleted. Just try

p4 sync -n @changelist | more

+1
source

To summarize the other answers and add one of my own: roll 1d3 and select from this table.

  • p4 sync -f @=CHANGE
  • p4 sync -f @CHANGE,CHANGE
  • p4 -F %depotFile%%depotRev% files @CHANGE,CHANGE | p4 -x - sync -f
0
source

All Articles