Resolving Conflicts

Conflicts occur when a file that contains local modifications is updated with overlapping changes from the latest version in the repository.

Conflicted files can’t be committed until the conflicts have been resolved.

Resolving Individual Conflicts

A conflicted text file contains markers inserted by Subversion that identify the local and remote changes:

#import "ActivityLog.h"
#import "Database.h"
<<<<<<< .mine
static ActivityLog * sharedInstance = nil;
=======
extern ActivityLog * defaultActivityLog;
>>>>>>> .r2839

In this example, the section beginning with <<<<<<< .mine on line 23 contains the local change from the working version. The code on line 25 is the change from the latest version in the repository (marked as revision .r2839).

To resolve the conflict:

  1. Accept or reject each modification, conferring with the team member responsible for the conflicting change. Non-trivial conflicts may require significant re-implementation of the local changes to resolve.
  2. Mark the conflict as resolved using Working Copy > Resolve Conflicts (key equivalent ⌘K) or click the Resolve button in the view’s toolbar:

    Resolve

Once resolved, the file is marked as modified and the changes can be committed like any other modification.

Opening Conflicted Files

When a conflicted file is selected in the browser, the following toolbar buttons are displayed in the view’s toolbar:

Compare with BASE

Compare with HEAD

Compare with MINE

These buttons can be used to compare the various file versions relevant to the conflict against the merged working version.

The Open button in the view’s toolbar also gains a popup menu:

Open

Clicking and holding the Open button will display a popup menu allowing you to select which of the HEAD, BASE, .mine and merged (i.e. working) versions should be opened.

Resolving Conflicts on a File-by-File Basis

Sometimes you may be able to resolve all the conflicts in a file given the knowledge, for example, that the changes implemented by one team member will take precedence over another’s.

The conflict bar makes it easy to resolve a file to a particular revision:

  1. Select the version of the file you wish to resolve to from the popup menu on the right-hand side of the bar.
  2. Click and hold the Resolve button in the view’s toolbar.
  3. Select a revision to resolve to (HEAD, BASE, .mine or working/merged) from the popup menu displayed.

Resolving Conflicts with an External Compare Tool

Cornerstone also provides support for using external compare tools to resolve conflicts. See the dedicated topic in the Integration section for more information.