How to unshelve a shelved changelist to another branch prior to Perforce 2013?

You're looking at the right command, but possibly not the right parameters. This is how I use it:

p4 unshelve -s 77655 -b MY_BRANCH_SPEC

which unshelves changelist 77655, using the specified branch specification to map the files to the new branch.

Critically, you need to make sure that both the specified branch mapping and your current workspace mapping contain both the source and destination files, otherwise you will get the "file not mapped" error.

The other answers didn't work for me, this is what I did using perforce 2014:

  1. Edit your current workplace so that both //depot/product/B1/... and //depot/product/B2/... are mapped in it (not to each other, to your workspace like normal mappings)
  2. In P4V, go to "Branch Mappings" (View menu->Branch Mappings )
  3. Ctrl+N to start a new mapping (or right click the list and choose "New Branch Mapping..." )
  4. Under "Branch Mapping" provide a name like B1_TO_B2
  5. Replace the mappings under View to be for example

    //depot/product/B1/...       //depot/product/B2/...  
  6. OK
  7. Create an empty Changelist where your unshelved files will be placed (otherwise they will go to "default" changelist). The number of this new changelist will be < TARGET_CL > in the command below.
  8. In the command line, run

    p4 unshelve -s <SOURCE_CL> -c <TARGET_CL> -b B1_to_B2
    • If it doesn't work, make sure the correct workspace is set in .p4config
  9. Now all you have to do is resolve the files in < TARGET_CL >