Open files for branching or merging.
p4 integrate can be abbreviated as p4
integ.
p4 [g-opts] integrate [options] fromFile[revRange] toFilep4 [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] [file[revRange] ...]
For [options], you can use:
-c changelist -Di -f -h -O[b][r] -n -m max -R[b][d][s] -q
When you’ve made changes to a file that need to be propagated to another
file, start the process with p4 integrate. The
command includes four syntax variants, depending on whether the source
and target files are specified using files, branches, or streams.
The simplest syntax variant is p4 integrate fromFiletoFile; this lets the versioning service know that
changes in fromFile need to be propagated to
toFile, and has the following effects:
toFile does not 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 the file with the most edits in common
as the base.
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.p4
move, or whether you use native OS commands to
rename files within your workspace (using p4 reconcile or p4 status to update your
changelist to reflect the moves you made), p4
integrate automatically detects these actions, adjusts
the source-to-target mappings appropriately, and schedules a filename
resolve for each remapped file pair.(Some of the available options modify this behavior. See Options for details.)
The process is complete when you p4
submittoFile to the depot.
If you integrate from a classic branch or other stream depot to a task stream, the files are not copied up to the parent unless they are edited and submitted first.
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 fromFilestoFiles 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.
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
+S) do not produce a lazy copy; the
integrated ntempobj file consumes additional diskspace on the
server.
Alternatives to p4 integrate include the
following:
p4 populate to quickly branch files without
opening them in a workspace.p4 copy to open files to be copied without
scheduling any resolves.p4 merge to open files to be merged and schedule
resolves for all changes.Because some of the integration options add complexity to the integration process, we’ve divided the options into Basic Integration Options and Advanced Integration Options.
|
|
Integrate the files using the
If a revision range is supplied with
|
|
|
Any |
|
|
Display the integrations this command would perform without actually performing them. |
|
|
Open the If this option is not provided, the files are opened in the default 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 Global Options. |
|
|
In its simplest form, In its more complicated form, when both
This variation of |
|
|
Reverse the mappings in the branch view, integrating from the target files to the source files. |
|
|
The This flag is intended to be used for the documented purposes
only, otherwise it might produce unintended integration results.
For example, using the |
|
|
Force the integration on all revisions of
|
|
|
Don’t automatically sync target files to the head revision before integrating. Use the have revision instead. |
|
|
Limit the command to integrating only the first
|
|
|
The |
|
|
The |
|
|
The |
|
|
The |
|
|
The |
|
|
Integrates a stream to its parent. To reverse the direction of the mapping, use the To override the configured parent and integrate to a different
target stream, specify To submit integrated stream files, the current client must be switched to the target stream or to a virtual child stream of the target stream. |
| Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required |
|---|---|---|
|
Yes |
Yes |
|
|
|
Branch or merge all files in If there is no corresponding file in |
|
|
Branch or merge all |
|
|
Branch or merge those |
|
|
Branch or merge |
|
To create or edit a branch mapping |
|
|
To view a list of existing branch mappings |
|
|
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 |
|
|
To view a history of all integrations performed on a particular file |