Perforce Command Reference:   [Index] [Prev] [Next]


p4 integrate

Synopsis

Schedule the propagation of changes from one file to another

Syntax

p4 [g-opts] integrate [options] fromFile[revRange] toFile
p4 [g-opts] integrate [options] -b branch [toFile[fromRevRange]...]
p4 [g-opts] integrate [options] -b branch -s fromFile[revRange] [toFile...]
options: -c changelist# -f -n -r -v

Description

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 Perforce server know that changes in fromFile need to be propagated to toFile, and has the following effects:

The process is complete when you p4 submit toFile to the depot.

Multiple files can be specified by using wildcards in fromFile and toFile. If so, any wildcards used in fromFile must be matched with 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 remember the relationship 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; then use p4 integrate -b branchview whenever you need to propagate changes between fromFiles and toFiles.

Options

-b branchname Integrate the files using the fromFile/toFile mappings included in the branch view of branchname.
-b branchname toFiles... Integrate the files using the source/target mappings included in the branch view of branchname, but include only those target files that match the patterns specified by toFiles.
-f 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.
-n Display the integrations this command would perform without actually performing them.
-r Reverse the usual order of propagation: propagate changes from toFiles to fromFiles.
-v Without this flag, p4 integrate will copy newly-branched toFiles into the client workspace from fromFiles. When the -v (for virtual) flag is used, toFiles are not immediately copied to the client workspace. Instead, you can fetch them with p4 sync when you need them. This flag allows you to branch large codelines without having to copy the entire codeline to the client workspace.
-b branchname -s
fromFile
[revRange]
[toFile...]
In its simplest form, p4 -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 will be 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 P4Win, the Perforce GUI; it is unlikely that you'll need to use this more complex form.
-c changelist# Open the toFiles for branch, integrate, or delete in the specified pending changelist. If this option is not provided, the files will be opened in the default changelist.
g_opts See global options section.

Usage Notes

Can File Arg Use
Revision Specifier?
Can File Arg
Use Revision Range?
Minimal
Access Level Required
Yes Yes open

Examples

p4 integ //depot/dev/... //depot/rel2/... Schedules the propagation of changes from all files in
//depot/dev/...
to their corresponding files in
//depot/rel2/... If there is no corresponding file in
//depot/rel2/..., this creates it.
p4 integ -b rel2br Schedule the propagation of changes from all fromFiles contained in the branch view rel2br into the corresponding toFiles as mapped through the branch view.
p4 integ -b rel2br //depot/rel2/headers/... Schedule the propagation of changes from those fromFiles contained in the branch view rel2br that map to the toFiles
//depot/rel2/headers/...
p4 integ -b rel2br -r //depot/rel2/README Schedule the propagation of changes to the fromFile
//depot/rel2/README from its toFile as mapped through the branch view rel2br.

Related Commands

To create or edit a branch specification p4 branch
To view a list of existing branch specifications p4 branches
To view a list of integrations that have already been performed and submitted p4 integrated
To propagate changes from one file to another once scheduled with p4 integrate p4 resolve



Perforce Command Reference:   [Index] [Prev] [Next]


Copyright 1999 Perforce Software.
Contact us at [email protected]
Last updated: 09/15/99 (Manual version 99.1.cr.6)