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


p4 resolve

Synopsis

Merge open files with other revisions or files

Syntax

p4 [g_opts] resolve [-af -am -as -at -ay -f -n -v] [file...]

Description

Resolve handles file integrations through an interactive dialog. If no file is named all open files requiring integration will be acted upon.

Perforce detects the occurrence of parallel changes, requiring a merger of changes and resolution of potential conflicts. Resolution may be either textual or non-textual. Textual resolution occurs when there are parallel edits to related text files. In this case it may be possible to comingle edits meaningfully. Non-textual resolution occurs when at least one of the related files is binary, or the change actions themselves are incompatible, such as when one file has been deleted while the other file has been edited.

For textual resolution you are provided with a file containing a merger of your changes in the working file on the client (yours) with the parallel changes that have been made in the depot (theirs), based on a common original ancestor revision of the two parallel versions (base).

The display presents a count of change sections of the merged text according to whether they are:

yours: change is only in your working revision (no conflict)

theirs: change is only in the depot revision (no conflict)

both: same text added or changed in both (no conflict)

conflicting: conflicting changes between yours and theirs

If the count for 'conflicts' is non-zero then the merged version will contain integration marks bracketing alternative changes at places in the text where conflicts occur. You must edit the file to resolve the conflict and remove the integration marks.

For non-textual resolution no merge file is created and you are given the choice of choosing yours or theirs.

Choices for action include:

Accept at Keep only changes to their file
ay Keep only changes to your file
*am Keep merged file
*a Keep autoselected file
Diff *dt See their changes alone
*dy See your changes alone
*dm See merged changes
d Diff your file against merged file
Edit et Edit their file (read only)
ey Edit your file (read/write)
*e Edit merged file (read/write)
Misc. *m Run '$MERGE base theirs yours merged'
s Skip this file
h Print this help message
^c Quit the resolve operation

Options marked (*) appear only for textual resolution.

Any form of Accept marks the resolution complete (to the users satisfaction). Skip leaves the integration marked unresolved allowing you to return to it at a later time.

The Merge option allows you to invoke your own integration and conflict resolution utility (named in the $MERGE environment variable). This utility is expected to replace the existing merged file with a new one.

The -am flag puts 'p4 resolve' into automatic mode: if there are conflicts, the file is skipped; if there are no conflicts and yours hasn't changed it accepts theirs; if theirs hasn't changed it accepts yours; if both yours and theirs have changed it accepts the merge. Files that have no base for merging (e.g. binary files) are always skipped.

The -af flag forces 'p4 resolve' in automatic mode to accept the merged file even if there are conflicts.

The -as flag performs a 'safe' automatic resolve, accepting only files that have either your changes or their changes, but not both. Files with changes to both yours and theirs are skipped.

The -at and -ay flags perform an automatic resolve that skips the merging. Instead it automatically accepts their (-at) or your (-ay) version of the file. The -at flag should be used with care, as it overwrites any changes made to the file in the client workspace.

The -f flag allows previously resolved files to be resolved again. Normally, once files have been resolved then 'p4 resolve' won't display them again.

The -n flag lists the integrations which would be performed without actually putting the user into the resolution dialog. No resolution is performed.

The -v flag causes 'p4 resolve' to put in markers for all changes, not just those in conflict. The markers must be edited out before the merged file can be accepted.



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


Copyright 1998 Perforce Software.
Contact us at [email protected]
Last updated: 06/14/98