views:

2650

answers:

3

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).

+1  A: 

"Enable integrate over deleted targets" can lead to problems if done blindly. Here's an example: Imagine you refactor your code in your next release branch, and eliminate a source file as a result - the functionality was merged into some other source files. You then fix a bug in that original source file in a maintenance branch for the previous release. If you integrate over delete by default, the dead source file comes back, but it won't be built and the bug wouldn't have been fixed. It'd better to be warned that this occurred so you could manually merge the fix into the other source files.

Michael
While your warning is well taken, shouldn't P4 just show that the re-added file needs to be resolved, rather than throw an error message at me?
Jeff Meatball Yang
+5  A: 
  1. In general, to merge two files, perforce looks for a "base", the closest revision to the two files, and uses that to provide a much better diff than just directly running a diffing the two files. See Knowledge Base Article. Without knowing your perforce setup, I couldn't say what was going wrong, however, p4win has some nice graphical tools to visualize branches, you might be able to determine why perforce can't find a base for you. This is also what "Disregard indirect integration history" does: stops it from looking for the base.

  2. For the "don't sync to head": when integrating, your "target" is the files in your local client, which you aren't specifying a revision for; instead, perforce will either sync your revision head (if you don't use "-h"), or will use the one you currently have. You can't specify an arbitrary revision because your local client only has a particular one.

Todd Gardner
Thanks for the clarification on what p4 means by base! And I guess this means that if I have my branch's file checked out, but I'm trying to integrate over it from another branch... P4 will use my checked-out/edited file as the "yours" version in a diff, versus the head revision?
Jeff Meatball Yang
+5  A: 

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.

raven
YOu might also check what version of Perforce that you are running. Your server version might be far behind. I've never seen the 'disregard indirect integration history' - maybe you are running an older server version? I'm looking at 2008.2 docs and don't see reference to that.
Mark
I am using P4V, the Perforce Visual Client, as of 2009 March 25. This is a completely new interface for me, since I am also used to the 2008.2 P4Win client.@raven: thanks for the examples.
Jeff Meatball Yang