How do I check in a different branch than I check out from in perforce
I wish to check my changes into a different branch than the files were check out from. All the files there are the same “version” in each branch, Perforce should know this from tracking the integrations that ha开发者_如何学Cve been done. (So no merging need to be done)
According to the Perforce Blog, the p4 move -f
command will move your edit from one branch to the other. From the blog
This can be a real lifesaver if (as I did a few weeks ago) you start working on a fix in your mainline, and then decide that it needs to go into your release branch instead. Previously you would have needed to save a copy of your work, revert it, open the files in the release branch, and copy your edits back in manually — now you just “p4 move -f main/… rel/…” and all your edits go where you need them.
This is a new feature added in version 2010.1 (this year I believe) so that's probably why tech support didn't know about it.
Use "p4 move" if you have version 2009.1 or later. Just move to the new branch and revert from the old branch.
I just got an answer from support@perforce.com
You cannot check files into a branch that they weren't checked out from. You need to open those other files for edit and copy your changed files over.
(I am now beginning to understand why pressure is building up from some the programmer I work with to to move to Mercurial)
精彩评论