Resolve branched files, deletions, moves and filetype changes

Beyond reconciling changes to the contents of related files after integration, you can also determine how other kinds of changes are handled. Consider this example:

  • You edit header.cc in the mainline while a coworker deletes it in the release branch (or vice versa). You integrate fixes in the release branch back to main. During resolve, you can decide whether header.cc is deleted from the mainline or the action in the release branch is ignored, preserving header.cc in the mainline.
  • A developer implements RCS keywords in source files in a development branch, and changes their Helix Server filetype from text to text+k. The release manager wants to integrate new features from the development branch to the mainline, but does not want to enable keyword expansion in the mainline. During resolve, the release manager can choose to ignore the filetype change.
  • The file header.cc is branched from main to rel. Subsequently, it’s renamed to headerx.cc in main, and moved in the release branch to the headers subfolder.

Following are simple cases describing how you can resolve non-content changes to related files. After a source file is branched to a target file, changes are made as describe below, then you integrate the source to the target. To choose the outcome, you specify the resolve options at (“Accept Theirs”) or ay (“Accept Yours”) as follows:

  • The source is edited and target is deleted: the at option re-adds the source in the target branch. The ay option causes the file to remain deleted in the target branch.
  • The source is deleted and the target is edited: the at option causes the file to be deleted in the target branch. The ay option retains the edited content in the target branch.
  • The target file was moved after being branched: the at option moves the target file to the source file name and location. The ay option retains the target file name and location.
  • The filetype of the source file was changed after it was branched: the at option propagates the change to the target. The ay option leaves the filetype of the target unchanged. If the differing filetypes do not conflict, you have the option of combining them.
  • Files have been moved or renamed in conflicting ways: you are prompted to choose a path and filename. Example:

    Resolving move to //Acme/rel/headerx.cc
    Filename resolve:
    at: //Acme/rel/headerx.cc
    ay: //Acme/rel/headers/header.cc
    am: //Acme/rel/headers/headerx.cc

By default, the p4 resolve command resolves all types of change, content and non-content. To constrain the type of actions that you want to resolve, specify the -A option as follows:

Option What is Resolved

-Aa

Resolve attributes set by p4 attribute.

-Ab

Integrations where the source is edited and the target is deleted.

-Ac

Resolve file content changes as well as actions.

-Ad

Integrations where the source is deleted and target is edited.

-Am

Renames and moves.

-At

Filetype changes.

-AQ

Charset changes.

To perform more than one type of resolve, combine the options (for example: -Abd). By default, resolving is performed file by file, interactively. To specify the same outcome for a particular action (for example, propagate all moves), and avoid the prompting, include the desired option on the command line. For example: p4 resolve -Am -at