|
p4 [g-opts] integrate [options] fromFile[revRange] toFile
p4 [g-opts] integrate [options] -b branch [-r] [toFile[RevRange]...]
p4 [g-opts] integrate [options] -b branch -s fromFile[revRange] [toFile...]
p4 [g-opts] integrate [options] -S stream [-r] [-P parent] fromFile[revRange]When you've made changes to a file that need to be propagated to another file, start the process with p4 integrate. The simplest form of this command is p4 integrate fromFile toFile; this lets the versioning service know that changes in fromFile need to be propagated to toFile, and has the following effects:
• If toFile doesn't yet exist, fromFile is copied to toFile, then toFile is opened for branch in the client workspace.
• If toFile exists, and shares a common ancestor with fromfile as above, then toFile is opened for integrate. You can then use p4 resolve to propagate all of, portions of, or none of the changes in fromFile to toFile.The p4 resolve command uses fromFile as theirs, toFile as yours, and (if the resolve was scheduled with p4 integrate), the closest common ancestor of fromFile as base, or (if the resolve was scheduled with p4 merge) the file with the most edits in common.
• If both toFile and fromFile exist, but toFile shares no common ancestor with fromFile, the integration is rejected.
• If fromFile was deleted at its last revision (and all previous changes have already been integrated between fromFile and toFile), toFile is opened for delete in the client workspace.(Some of the available flags modify this behavior. See the Options section for details.)To specify multiple files, use wildcards in fromFile and toFile. Any wildcards used in fromFile must match identical wildcards in toFile. Perforce compares the fromFile pattern to the toFile pattern, creates a list of fromFile/toFile pairs, and performs an integration on each pair.The syntax p4 integrate fromFiles toFiles requires you to specify the mapping between fromFiles and toFiles each time changes need to be propagated from fromFiles to toFiles. Alternatively, use p4 branch to store the mappings between fromFiles and toFiles in a branch view, and then use p4 integrate -b branchview whenever you need to propagate changes between fromFiles and toFiles.In most cases, you can use the p4 merge and p4 copy commands to propagate changes between streams (or branches). When p4 integrate schedules files for resolve, it selects the closest common ancestor as the base, and p4 merge selects (as the base) the revision with the most edits in common with the source and target.Because some of the integration flags add complexity to the integration process, we've divided the options into Basic Integration Flags and Advanced Integration Flags
Integrate the files using the sourceFile/targetFile mappings included in the branch view of branchname. If the toFiles argument is included, include only those target files in the branch view that match the pattern specified by toFiles.If a revision range is supplied with toFiles, the range refers to source revisions, not target revisions. Display the integrations this command would perform without actually performing them. Open files for branching without copying toFiles into the client workspace.Without this flag, p4 integrate copies newly-branched toFiles into the client workspace from fromFiles. When the -v (virtual) flag is used, With this flag, you can save time by not copying toFiles to the client workspace. Instead, you can fetch them with p4 sync when you need them. -c changelist Quiet mode; suppresses normal output messages about the list of files being integrated, copied, or merged. Messages regarding errors or exceptional conditions are displayed. See the Global Options section.
In its simplest form, p4 integrate -b branchname -s fromFile allows you to integrate files using the source/target mappings included in the branch view of branchname, but include only those source files that match the patterns specified by fromFile.In its more complicated form, when both fromFile and toFile are specified, integration is performed bidirectionally: first, integration is performed from fromFile to toFile; then integration is performed from toFile to fromFile.This variation of p4 integrate was written to provide some needed functionality to graphical Perforce applications; it is unlikely that you'll need to use this more complex form. Reverse the mappings in the branch view, integrating from the target files to the source files. The -Dt flag allows integration around a deleted target file; if the target file is deleted, it is restored with the branched source file.The -Ds flag allows integration around a deleted source file; if the source file has been deleted, any modified target file is also deleted.The -Di flag ignores the fact that a source file was deleted and re-added when searching for an integration base. Force the integration on all revisions of fromFile and toFile, even if some revisions have been integrated in the past. Best used with a revision range. Don't automatically sync target files to the head revision before integrating. Use the have revision instead. -m max The -Ob flag outputs the base revision for the merge (if any). The -Or flag outputs the the resolves that are being scheduled. Integrates a stream to its parent. To override the configured parent and integrate to a different target stream, specify -P.
Can File Arguments Use
Revision Specifier? Can File Arguments Use
Revision Range? Minimal Access Level Required
• p4 integrate can be abbreviated as p4 integ.
•
• By default, files that have been opened for branch or integrate with p4 integrate are read-only in the client workspace. You can edit these files before submitting them using p4 edit to reopen the file for edit.
• Whenever a toFile is integrated from a fromFile, Perforce creates an integration record in its database that describes the effect of the integration. The integration record includes the names of the fromFile, and toFile, the revisions of fromFile that were integrated into toFile, the new revision number for toFile, and the action that was taken at the time of the integration. See p4 integrated for a full description of integration actions.
• In most cases, p4 integrate performs a lazy copy; the contents of the file are not duplicated on the server, because the integration record contains sufficient information to reproduce the file. Integrations performed on temporary object files (+S and +Sn) do not produce a lazy copy; the integrated tempobj file consumes additional diskspace on the server.The new integration engine (v3) was introduced in the 2011.1 release and provides improved base selection semantics and expanded resolve capability. The default integration engine is still the (v2) engine which has been around since its first release in 2006.New installations of Perforce are encouraged to select the new integration engine as the default. Existing installations can compare the two engines by comparing the behavior of p4 merge and p4 integrate against their individual code bases and switch to the new engine on a sitewide basis when ready. (The p4 merge command simplifies integration by always using the new v3 engine; users of streams-based branching strategies are already using the new engine.)To enable the new integration engine on a sitewide basis, set the dm.integ.engine configurable to 3, instead of its default value of 2:
If there is no corresponding file in //depot/rel2/..., this creates it. Branch or merge all fromFiles contained in the branch view rel2br into the corresponding toFiles as mapped through the branch view. Branch or merge those fromFiles contained in the branch view rel2br that map to the toFiles //depot/rel2/headers/... Branch or merge fromFile //depot/rel2/README from its toFile as mapped through the branch view rel2br.
To view a list of integrations that have already been performed and submitted To propagate changes from one file to another after opening files with p4 integrate To view a history of all integrations performed on a particular file
|