tags:

views:

220

answers:

1

Problem: 2 projects shared trunk and were updating some of the same files. Now one project needs to be released, so a new branch was created from a checkpoint before the projects started.

I have a list of just my changelist numbers from the mainline. Using that I can generate a list changed files and diff output using a script with a series of 'p4 describe #' commands.

Can I reformat that output and apply it to the new branch somehow?

+3  A: 

Perforce will let you cherry-pick changelists for integration, which may be easier than trying to generate and apply a patch. Perforce will keep track of what revisions you've integrated where, which may make future integrations easier.

Let's assume you used to have one trunk:

//depot/mycode/trunk

And you checked in all of your changes there. You branched trunk at some point in the past to:

//depot/mycode/rel

And you have a list of changelists on trunk to merge. From a client spec that maps rel, integrate each changelist:

p4 integrate //depot/mycode/trunk/...@1234,1234 //depot/mycode/rel/...

where 1234 is the changelist number. Resolve after each integration. You may also wish to build, test, and commit your integrations at various checkpoints during your integration, if you can identify good points to do so. (Perforce can handle multiple integrations per commit, but if you make a mistake you'll need to revert to the last version checked in and redo the intermediate integrations and resolves.)

Commodore Jaeger
Why do I need to resolve if I'm going to be the only one checking in? Doesn't integrating the changelist only factor in code that was modified for that commit? I can picture conflicts if it was looking at the whole file.
webXL
Perforce makes you resolve every time you integrate in case you need to address, by hand, any conflicts. In your case, you'd get conflicts if your new changelist altered code added in a previous changelist.
Commodore Jaeger