Can someone explain the perforce integration options

integrationmergeperforceversion control

Specifically:

  • Why do I need to explicitly enable "Enable baseless merges" all the time? I am integrating from my branch to the trunk.

  • What does "Enable integrate over
    deleted targets" mean? Shouldn't it
    do this by default? If the file
    doesn't exist, and you integrate to
    that branch with the file, it should
    create the file, right??

  • What does "Do not get latest revision
    of selected files" have to do with
    integrating? I should be choosing a
    source revision, and a target (to
    create a new target revision).

  • What does "Disregard indirect
    integration history" mean? I've never used it, since it sounds scary.

I would be grateful to know, as I am a little unsure of what options to enable when I am trying to do various integration tasks from our trunk to various branches or vice versa. (I am not the buildmaster, but hey, I want to know what he knows).

Best Answer

Why do I need to explicitly enable "Enable baseless merges" all the time? I am integrating from my branch to the trunk.

Can't help you here. Something is not right.

What does "Enable integrate over deleted targets" mean?

If the target file has been deleted and the source file has changed, will re-branch the source file on top of the target file. Without this option, a file on the branch, that has been changed on the branch and deleted on the trunk, would not be allowed to be integrated back into the trunk.

Shouldn't it do this by default?

Not if you are integrating a file back into the trunk, which you branched from the trunk, then deleted on the trunk. Normally 'p4 integrate' avoids mixing outstanding edits with a deleted file. You have to use the advanced options to tell it how to deal with a deleted file.

If the file doesn't exist, and you integrate to that branch with the file, it should create the file, right?

When integrating a file, that previously never existed (i.e., it was added to the branch), from one location to another, yes, Perforce will simply create it in the location into which you are integrating. However, if the file originally came from the trunk, was deleted on the trunk, and now you're trying to integrate it back into the trunk from the branch, you have to tell it what to do via these integration options. Here's the command line switches to which these options correspond:

  • Enable integrations around deleted revisions = -d
  • Integrate over deleted targets = -Dt
  • Delete target file when source is deleted = -Ds
  • Try to integrate changes when source is deleted and re-added = -Di

You can learn more about them in the integrate command help (type "p4 help integrate" at the command line).

What does "Do not get latest revision of selected files" have to do with integrating?

This tells Perforce to use the workspace revision of the target file. By default, the head revision of the target file is automatically retrieved into the workspace before integrating. Say you have made one revision to a branch file and integrated it back into the trunk. The trunk and branch now have two revisions of this file. You submit a change to the branch file so it now has 3 revisions. You sync the branch file back to revision 2. If you were to do a normal integration right now, Perforce would assume you want to integrate everything up to the head revision and would integrate revision 3 of the branch file into the trunk. If you were to select this option, it would say, "all revision(s) already integrated" because you have revision 2 in your workspace. It would be the same as attempting to integrate with the "Limit the range of the integration:" option set to "Integrate all revisions up to:" Revision 2.

What does "Disregard indirect integration history" mean? I've never used it, since it sounds scary.

I can't figure out, nor find any info about, what this does.