Using Perforce Server 2012.2/538478, how can I unshelve files from the trunk to another branch?
When trying to do it, I get:
//filename... (not mapped to your workspace view)
In Perforce 2013, I found this unshelve command to really be helpful:
p4 unshelve -s <changlist#-with-shelved-files> -S //depot/streamname
But with the version I'm using currently, I found nothing to help me with that issue.
Any suggestions?
Specifies a branch spec through which the shelved files will be mapped prior to unshelving. This option enables you to shelve files in one branch and unshelve them in another. Specify a changelist number in the user’s workspace into which the files are to be unshelved. By default, p4 unshelve retrieves files into the default changelist.
To submit shelved files in a pending changelist, right-click the changelist or shelved files folder and select Submit Shelved Files. Shelved files remain shelved until you delete them from the pending changelist. To delete a shelved file from a pending changelist, right-click the file and choose Delete.
Perforce Server has the ability to choose a different destination branch/stream for files to be unshelved to. Perforce Server has the ability to be able to specify an arbitrary effective parent stream via the -P option when used in conjunction with the -S option, so you can unshelve across non-parent-child streams.
You only need to have the target branch in your workspace view. If the shelved files are in the target of the branchspec (option -b) or in the parent of the stream (option -S ), the direction is automatically reversed. If the files are already open for edit in your workspace, as usual you need to resolve them.
The other answers didn't work for me, this is what I did using perforce 2014:
Replace the mappings under View to be for example
//depot/product/B1/... //depot/product/B2/...
In the command line, run
p4 unshelve -s <SOURCE_CL> -c <TARGET_CL> -b B1_to_B2
After spending sometime searching and reading, I have not come across a concrete example for unshelving a shelved changelist to another branch. finally I put together a concrete example.
Assuming you have a shelved changelist 324426 in Branch B1 and want to unshelve it to Branch B2.
I was able to create branch spec, then unshelve changelist to another branch. here is exactly what I did:
1. Create a text file named branchSpec.txt, with the content below: set you own Branch name and View.
Branch: B1_to_B2
View:
//depot/dev/main/B1/... //depot/release/B2/...
2. p4 branch -i < branchSpec.txt (in target directory)
3. p4 unshelve -s 324426 -b B1_to_B2 (in target directory)
Viola, shelved files in changelist 324426 in B1 now is unshelved to B2 and ready to be submitted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With