Ian Ringrose
Ian Ringrose

Reputation: 51927

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 have been done. (So no merging need to be done)

Upvotes: 1

Views: 462

Answers (3)

Ian Ringrose
Ian Ringrose

Reputation: 51927

I just got an answer from [email protected]

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)

Upvotes: 0

Chance
Chance

Reputation: 2700

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.

Upvotes: 3

JasonMArcher
JasonMArcher

Reputation: 15011

Use "p4 move" if you have version 2009.1 or later. Just move to the new branch and revert from the old branch.

Upvotes: 0

Related Questions