Branching and merging

Using P4 for Eclipse, you can branch Eclipse projects - for example, for release or experimental development - and merge changes between branches to obtain changes made by other users or to incorporate your changes into collaboratively-developed projects.

Branching

Branch a project:

  1. Right-click the project in the P4 Connections view and choose Integrate.
  2. In the Target field, specify a location for the branched project, using the P4 Server depot syntax. For an overview of depot syntax, see Specifying filenames on the command line in the P4 CLI Documentation.
  3. If required, specify integration options. For a list of integration commands, see Branch and integration reporting in the P4 CLI Documentation.
  4. Click Integrate. P4 for Eclipse creates a changelist containing the files to be branched, marked for add.
  5. In the P4 Pending Changelists view, right-click the changelists containing the branched files and choose Submit...
  6. The P4 Server Change Specification is displayed.

  7. Enter a description and click Submit.
  8. P4 Server branches the files to the specified target location.

Branch specifications

To simplify integration, you can save a set of branch-to-branch mappings as a named branch specification.

Display branch specifications for the current server:

  1. Select Window > Show View > Other....
  2. Browse to P4 > P4 Branches.
  3. In this view, you can create or edit branch specifications and integrate changes.

Create a branch specification:

  1. To display the branch specifications for the current server, choose Window > Show View > Other....
  2. Browse to P4 > P4 Branches.
  3. Click Add Branch button image and, in the Branch dialog, specify the details.
  4. In the View field, specify the source/target mapping using P4 Server depot syntax.
  5. Depot syntax supports the following wildcards:

    • * matches all characters except slashes (use for a path component)
    • ... matches all characters including slashes (use to specify a directory and all its subdirectories)

To integrate To compare two sets of files and determine which changes to propagate. A typical use case is to integrate between a development branch and a release branch. changes using a branch specification, right-click the specification and choose Integrate...

For a list of integration commands and an overview of depot syntax, see Branch and integration reporting and Specifying filenames on the command line in the P4 CLI Documentation.

Merging

As with branching, to merge changes, select the source project, choose Integrate..., and specify a target path. The difference is that, when you merge, the target files already exist and you are required to resolve them before P4 Server permits you to submit.