Merging files between codelines

To create a new codeline (referred to as branching(noun) A set of related files that exist at a specific location in the Perforce depot as a result of being copied to that location, as opposed to being added to that location. A group of related files is often referred to as a codeline. (verb) To create a codeline by copying another codeline with the 'p4 integrate', 'p4 copy', or 'p4 populate' command.) or propagate a bug fix or new feature from one codeline to another, you integrate the required files to the target codeline. To integrate files, you open them for integration, specifying source and target, then submit the changelist containing the open files.

P4V performs three types of integration:

If you are merging changes into an existing codeline, you are required to resolve the files to ensure that you do not overwrite other users' changes and to preserve the file’s revision history. Typical steps for propagating changes from one codeline to another are as follows:

  1. Open files for merge.
  2. Submit the changelist.

    If there are conflicts, P4V notifies you and schedules the files for resolve.

  3. Resolve the files, deciding how changed files are to be submitted.
  4. Submit the changelist containing the resolved files.

When you open files for merge, you can specify the mapping of source to target using either a file specification or a branch mapping.

Note

The workflow for propagating change between streams ("merge up, copy down") is simple and specific. For more information, see Merging Down and Copying Up between Streams.

Note

In the P4 Command-line Client, the term integrate To compare two sets of files (for example, two codeline branches) and determine which changes in one set apply to the other, determine if the changes have already been propagated, and propagate any outstanding changes from one set to another.is used not only to encompass all three integration types (branch, merge, copy), but is also used synonymously with the P4V term merge1. To create new files from existing files, preserving their ancestry (branching). 2. To propagate changes from one set of files to another. 3. The process of combining the contents of two conflicting file revisions into a single file, typically using a merge tool like P4Merge..Within P4V, merge can refer both to merging files from one codeline to another and to merging conflicts between files (the function performed by P4Merge).

Open files for merge

To open files for merging:

  1. Select the source files and folders, then right-click and choose Merge/Integrate​.

    The Merge/Integrate dialog is displayed.

  2. For Merge method, choose Specify source and target files.

    The source files that you selected in step 1 are listed in the Source files/folders field.

  3. Specify the target files and folders by typing or browsing to the destination.
  4. To specify additional merge options, click the Options disclosure triangle.

    The Options panel appears.

    Specify integration options as follows:

    Resolve and Submit Options: These options enable you to specify whether files are submitted manually or automatically, and to configure how conflicts are resolved.

    Filter Options: Filtering enables you to choose a subset of the revisions that are queued for merging. For more information, see Searching and Filtering.

    Advanced Options: These options enable you to refine the results of the merge as follows:

  5. To perform the merge, click Merge.

    The specified files are opened for merge using any options you configured.

  6. Resolve and submit the files.

Click Set Defaults to open the Merge-Integrate preferences page, where you can set default behaviors for the Merge/Integrate dialog.