The Merge command combines two versions of an element, producing a new version. (That is, a successful merge operation always ends with a Keep. This is a software configuration management best practice.) AccuRev can process both content changes and namespace changes in performing a merge. By default, the merging of text-file contents is performed by AccuRev's own Merge tool, which uses a 3-way merge algorithm (see ).The Merge command can also handle any other kind of version-controlled element: binary file, directory, or link.A user preference enables you to configure a third-party tool for merging the contents of text files.
• Using Keep to create one or more versions of a text file in your workspace.
• Occasionally, someone else "gets there first". That is, both you and a colleague are working on the same file concurrently, each of you using a copy of the file in your own workspace. And the colleague promotes his changes to the common backing stream before you do.Before you can promote your own changes to the backing stream, you must first merge (that is, combine) the changes from your colleague's version with your changes. Merging ensures that no one's work is inadvertently lost or overwritten in a concurrent development environment.The File Browser makes it easy to tell which files require a merge prior to promotion. If a file needs to be merged in your workspace, the Details pane shows the file as having (overlap) status -- that is, the work of one or more of your colleagues has overlapped your own work. If you select Overlap in the File Browser's Searches pane, the Details pane displays all your (overlap)-status files: all files in the depot that you must merge before you can promote them from your workspace to its backing stream.Although the above scenario is by far the most common one, AccuRev's flexibility allows for other merge scenarios, too:
• You can modify the file in your workspace by "pulling in" the changes from any version of the file, not just the backing stream's version.
• You can merge the versions of the file located in any two dynamic streams or snapshots. This involves using the Change Palette.In all cases, however, you use the Merge tool in the same way, to combine the contents of two versions of the same file element.No matter which tool you've configured to merge versions, you invoke the Merge command in the same way: select one or more files with (overlap) status, then click theMerge toolbar button. Alternatively, choose Merge or Merge From on the selection's context menu. For example:
•
• In the History Browser (when invoked from a workspace), to merge from the version in a particular transaction.
• In the Change Palette, to merge versions in higher-level streams. (You must choose a workspace to use for the merge process.)
• Prompts you to resolve namespace-level conflicts between the file in your workspace and the other specified version. This involves making choices in one or more dialogs.
• Invokes AccuRev's Merge tool or the other tool you've configured, in order to merge the contents of the two versions. AccuRev's Merge tool opens in a separate tab within the AccuRev GUI window; any other tool opens in its own window.If you select multiple files, you can choose to have the Merge tool process as many of them automatically as possible.An automatic merge is possible if there are no conflicting changes between the two versions being merged. For files in which there are conflicting changes, the Merge tool always opens an interactive Merge tab.In all cases, one of the contributors to a merge operation is the file in your workspace. If you've just saved the file with the Keep command, the file in your workspace is identical to the most recent version in your workspace stream. But if you invoke Merge on a file that you've edited but not yet saved with Keep, AccuRev uses the file, not the latest workspace-stream version. Keep'ing before Merge'ing is an AccuRev best practice.
AccuRev, Inc. |
Phone: 781-861-8700 |
Fax: 781-861-8704 |
support@accurev.com |