I'm fairly new to Perforce but I already have experience with DVCS like Git and Mercurial and I'm familiar with the basic principles of Perforce.
I played a bit with p4v
today and made a branch of some play code by using the Integrate...
function. I later modified the source branch and wanted to integrate those changes to the new branch as well. However, all single changelists were consolidated to one big changelist. That doesn't seem best practice to me. If you develop a feature or a bug fix you will naturally have multiple submits because each submit should be atomic.
How can I preserve the whole changelist when I merge or resolve?
"Best practice" depends on your workflow and how your branches are set up. There are indeed proper times to have a single changelist contain all of the integrated changelists - we do this quite a bit at our studio when creating "feature" branches and the branch needs the latest and up to date mainline code. On the other hand, per changelist integration can be very useful at the end of a product cycle when you need to branch specific fixes or features to a release branch.
Integration by changelist is easy:
From there you can either then preview and/or run the integrate. As a tip, I always preview the integration first. That will note potential errors or warning conditions that you might want to deal with before doing the actual integrate.
This method of integrating a changelist at a time is called "cherry picking". Perforce has a great knowledge base article about cherry picking changelists here.
Depending on how you develop, that is a good thing or a bad thing. Sometimes you want to cherry pick changes, othertimes you want everything.
If you only want 1 changelist to be merged, on the integrate screen, expand the arrow that says "Limit the range of the integration" Then you can choose which files get integrated. If you only want 1 changelist, select the "Integrate only revisions between" and select just your changelist for both. As you can see, you can also do it by revision, date, label, and workspace. It's very flexible that way.
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