Before John can either promote or update logic.xml, he must incorporate, or merge, the version in the backing stream, which contains Mary’s changes, into his own copy of the file. The Merge command is essentially a text editor, which combines the contents of two versions of a text file. The resulting merged version replaces the file in John’s workspace.
This figure shows how to run the Merge command from the File Browser toolbar. Merge is also available from the Actions and context (right-click) menus.
Often, a merge operation is unambiguous, and so can be performed automatically. For example, suppose Mary’s changes to file logic.xml all occur in lines 30–50, and all of John’s changes occur in lines 125–140.
In this case, merging the two versions involves replacing some or all of John’s 20 lines with Mary’s. Now, the edited version of logic.xml in John’s workspace contains both users’ changes.
If both John and Mary have made changes to the same part of the file, say, lines 2-10, then John must decide how to resolve this conflict. The graphical Merge tool makes this easy.
After performing a merge, AccuRev automatically Keeps the merged version to preserve the results of the merge operation. You can then Promote the merged version to the backing stream. After that, other team members can use Update, perhaps in conjunction with Merge, to bring all the changes into their workspaces.
The graphical Merge tool performs a three-way merge, which uses the common ancestor of the two versions being merged. This algorithm helps to automate the merge operation, often completely eliminating the need for human intervention. AccuRev performs merge operations on text files only. Binary files are merged by choosing which version to take.
AccuRev keeps track of all merge operations. This greatly simplifies subsequent merge operations on files that have been merged previously: you do not need to resolve the same conflicts over and over again.
The most common overlap situation happens when AccuRev prevents you from promoting a file, because someone else "got there first" in creating a version in the backing stream. AccuRev can also detect deep overlaps, in which another user "got there first" in creating a version in the parent of the backing stream, or in other higher-level streams.