PrestoSoft Blog :: Home

Monday, January 09, 2012

Three-Way Merge Coming in ExamDiff Pro 6.0

Here at PrestoSoft we've been hard at work on one of the biggest and most requested features we've ever done for ExamDiff Pro: three-way file merge. In three-way merge, three files are compared - a base file and two revision files ("yours" and "theirs") that are both modifications of the base - and the goal is to reconcile the changes made in the revision files into an output file.

Merge operations are started through the new Merge Files tab in the Compare dialog. In addition to the left ("theirs"), center ("base"), and right ("yours") files, an optional output file can be specified to store the results of the merge operation. If no output file is specified, the output (bottom) pane will be populated with merge results that can be saved to a file.


After clicking Merge, the main window is opened with the automatic merge results:


Note the three comparison panes and the output pane underneath. Each comparison pane has a color associated with it (shown in the pane header), and the diff blocks in the output pane are colored according to which file they were taken from. During the merge operation, ExamDiff Pro both separates the files into blocks and selects the appropriate block to choose for the output pane. Some blocks cannot be automatically reconciled (because all three files differ): these are denoted as "conflict" blocks and their diff bar is colored red. Conflicts must be manually reconciled, as explained below.

Instead of Added, Deleted, and Changed blocks (as in file comparison), there are now Matching, Non-Matching, and Conflict blocks.
  • In a Matching block, the left and right files both differ from the center file, but are themselves equal. In other words, the same change from base was made in "theirs" and "yours". ExamDiff Pro selects the right ("yours") file in this case.
  • In a Non-Matching block, either the left or right file differs from the center file, but not both. In other words, the change was only made in one file. ExamDiff Pro selects the file in which the change was made.
  • In a Conflict block, the left and right files both differ from the center files and are not equal to one other. In other words, different changes from base were made in "theirs" and "yours". ExamDiff Pro selects the center ("base") file and marks the block as a conflict. Conflicts must be manually resolved by the user (by selecting which of the three files to choose).

In our case, most of the blocks have been reconciled automatically, but there are still a few conflicts that I have to manually resolve. To resolve a conflict, I choose the file that I wish to use for the given block and press the diamond button on its diff bar. Alternatively, I can use the Merge | Select Left File, Merge | Select Center File, or Merge | Select Right File commands (or their corresponding toolbar buttons). When a conflict has been resolved, its diff bar color is changed from red to green. These commands can also be used for Matching and Non-Matching blocks, if I wish to override ExamDiff Pro's automatic merge.

There are two new options pages: Options | Merge and Options | Merge | Colors


In the Options | Merge page, you can specify which Ignore options are used in merge. These options are a subset of the Ignore options in Options | Compare. Note that when Ignore options are enabled, it's possible for the the contents of left and right files to differ within a Matching block (i.e. if they have different whitespace), but ExamDiff Pro will always automatically select the right ("yours") file in this case.


In the Options | Merge | Colors page, you can specify the colors and effects used in the comparison panes and the output panes, similarly to the Options | Display | Colors page. The colors associated with the left, center, and right files in the output pane are also used for the headers of the comparison panes.

Labels: ,

10 Comments:

OpenID y-serious said...

I am definitely looking forward to this! When can we expect a beta-release?

4:34 AM  
Blogger Larry Ingram said...

We expect beta in early summer.

6:58 AM  
Anonymous Martina said...

Is this released now? When I go to http://www.prestosoft.com/edp_beta.asp it says that beta release of version 6.0 is available. But when I follow the link I found version 5.5.1.18. If it is not released yet when we can expect?

9:43 PM  
Blogger Larry Ingram said...

We are expecting the Beta to be available this weekend.

9:56 PM  
Anonymous Anonymous said...

Hi,
I am looking forward to testing the 3way merge.
Do you have a tip how to include this in TortoiseSVN?
(I hate Tortoise's merge tool)

12:07 AM  
Blogger Larry Ingram said...

Thy the following:

ExamDiff /merge %theirs %base %mine /o:%merged /dn1:%tname /dn2:%bname /dn3:%yname /dno:%mname /nh

10:42 AM  
Anonymous jw said...

it is in beta now for quite some time. Any idea on when the final release will take place?

2:12 AM  
Blogger Larry Ingram said...

We expect the beta to last for a few more weeks. While it is very stable now, we want to make sure that no major bugs exist in 6.0.

8:50 AM  
Blogger James Frater said...

3-way file diff is very cool and anticipated, but will there also be 3-way folder diff?

6:33 AM  
Blogger Larry Ingram said...

We may implement three-way folder merge in the future, but it is not currently on our agenda.

6:35 PM  

Post a Comment

Links to this post:

Create a Link

<< Home