The Merge Command

Why Do I Need to Merge?

Higher-Level Merges

Invoking the Merge Command

The Merge command combines two versions of an element, producing a new version That is, a successful merge operation always ends with a Keep The operation (keep command) that creates a new version of a file element in a workspace, permanently recording in the AccuRev repository a change to the contents of the file.. This is a software configuration management best practice.. AccuRev can process both content A change to the contents of a file element, recorded in a new version created with the keep command. See namespace change. changes and namespace A change to the pathname of a file or directory element: either renaming the element in place or moving the element to a different location in the depot’s directory hierarchy. 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.

Notes (click to view):

Why Do I Need to Merge?

Perhaps the most common usage pattern in AccuRev is:

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.

Higher-Level Merges

Although the above scenario is by far the most common one, AccuRev's flexibility allows for other merge scenarios, too:

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.

Invoking the Merge Command

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 the Merge toolbar button. Alternatively, choose Merge or Merge From on the selection's context menu. For example:

You can merge versions in the following contexts:

AccuRev processes the files you specify one-by-one. For each file, it does one or both of the following

Notes (click to view):

 

Related Topics