P4Web Release 2005.2 User Guide
[Getting Started]  [How To...]  [Browser Tips]  [Glossary]  [Road Map]  

Integrating Files

The Perforce integrate command is used to branch new files from existing files, and to propagate changes between branched files. You can also use integrate to effectively rename files by branching new ones from existing ones and deleting the existing ones. Integrate opens target files in your workspace so you can branch or resolve changes from source files into them.

When used to branch new files, source file content is copied from the depot into new target files in your workspace. When you submit the target files, they are created in the depot.

When you use integrate to propagate changes between existing files, you will have to resolve the target files before you can submit them to account for changes in the source files.

P4Web lets you run integrate the following ways:

The Integrate page

On the Integrate page, you can choose how you want the integrate command to behave. After making your selections, you can preview or run the command. Some of the fields and options you'll see are specific to how you came to the Integrate page; they are explained here:

The following advanced options are common to all integration pages:

Limit revision range
Perforce keeps track of which revisions of a source file have already been integrated to a target file. Normally integrate opens the target if any source revisions have not yet been integrated. You can restrict which source files revisions will be considered by entering a revision range here.

  • You can use symbolic revision numbers (e.g.,"@12345") or absolute revision numbers (e.g., "#45").

  • If you enter a "starting with" revision, no source revisions prior to it will be considered. If you don't supply the "@" or "#" prefix, "@" will be assumed.

  • If you enter an "ending with" revision, no source revisions higher than it will be considered. If you don't supply the "@" or "#" prefix, it is assumed to be the same type of revision number as the starting revision you supplied, or "@" if you didn't supply a starting revision.

Put open files in changelist
If your client workspace has more than one pending changelist you can select one of them here. The files opened by the integrate command will be put in the pending changelist you select.

Enable baseless merges
Normally Perforce only opens a target file for integrate if it can find a common base between it and the source file to use as a base for doing a merge. A target file and source file not directly related to each other by branching have no common base; by default the target will not be opened in this case. You can use the "enable baseless merges" option to force target files to be opened even if they are not related to source files by branching. If you do this, Perforce arbitrarily chooses the #1 revision of the source files to use as a merge base.

Permit deletes/re-adds
If the ending revision of the source file is a deleted file, Perforce normally opens the target file for delete unless the target file has any revisions that have not themselves been integrated to the source file. If the source file exists and the target file does not, Perforce normally opens the target file for branch/add unless the target file is a deleted file. Checking the "permit deletes/re-adds" option makes the integrate command open the target file for delete or branch/add even if these conditions exist.

Re-branch source on top of deleted targets
If the source file exists and the target file does not, Perforce normally opens the target file for branch/add unless the target file is a deleted file. Checking this option opens the target file for branch/add even if it is deleted.

Delete modified targets if source is deleted
If the ending revision of the source file is a deleted file, Perforce normally opens the target file for delete unless the target file has any revisions that have not themselves been integrated to the source file. Checking this option opens the target file for delete even if it has been edited.

Force re-integration if previously integrated
Normally Perforce doesn't open a target file for integrate if all of the source file revisions under consideration have already been integrated to it. Checking the "force re-integration" option makes the integrate command open the target file for integrate regardless of previous integration history. When you submit the file, integration history between the two files will be effectively rewritten to reflect the most recent of the duplicate integrations.

Don't copy newly branched files to workspace
Normally target files opened for branch/add will be created in your workspace. However, since Perforce already knows that the content of the new target files are the same as that of the source files, your workspace files are not necessary to create the new files in the depot. If you don't need copies of the newly branched files in your workspace -- you are branching a large codeline, for example, but you don't plan to do work in the new codeline yourself -- use this option.

Change target filetype to match source
Normally, Perforce doesn't change the filetype of target files when you integrate to them. Each newly branched file is given a filetype that matches that of the file it was branched from. Subsequent changes to the source filetype will not affect the target file during integration unless you use this option. When you use this option, the filetype of each target file will be changed to match that of the corresponding source file at the revision you are integrating from. The filetype change takes effect when you submit the target files to the depot. (Note that you can also explicitly change the filetype of opened files before submitting them.)

Don't sync target files to head revision
Normally, Perforce automatically syncs to the head revision before integrating. If you select this option, Perforce uses the revision that you have in your workspace, instead of the head revision. Note that this is only true if your server is 2002.1 or newer.


Copyright 2005 Perforce Software. All rights reserved.