Concurrent Merge Concepts
In the DeltaV2 format produced by the merge and three-way merge objects, the deltaV2 attribute accurately describes the contributions of the input files to the merge result. However, subsequent processing is simplified if these deltas are classified to describe the types of change they represent. The current classification scheme describes changes in the result file as an add, a delete, or a modify.
Because we consider the ancestor version to be older than the other edits, the concepts of add and delete are defined relative to the ancestor:
-
add: something that does not exist in the ancestor, but does in one or more edits.
-
delete: something that exists in the ancestor, but is missing in at least one of the edits.
-
modify: other changes not already classified as an add or a delete.
The following table summarises where change classifications appear:
|
Classification |
textGroup |
attributes |
elements |
|---|---|---|---|
|
add |
✔ |
✔ |
✔ |
|
delete |
✔ |
✔ |
✔ |
|
modify |
✔ |
✔ |
— |
The analyzed deltaV2 output augments the default deltaV2 output by adding a deltaxml:edit-type attribute.
Examples
A simple word deletion
Consider Ben deleting the word 'quick' from a paragraph. The deltaV2 representation:
<p deltaxml:deltaV2="Original=Anna=Chris!=Ben">The
<deltaxml:textGroup deltaxml:deltaV2="Original=Anna=Chris">
<deltaxml:text deltaxml:deltaV2="Original=Anna=Chris">quick</deltaxml:text>
</deltaxml:textGroup> brown fox jumps over the lazy dog.</p>
The analyzed result adds deltaxml:edit-type="delete":
<p deltaxml:deltaV2="Original=Anna=Chris!=Ben">The
<deltaxml:textGroup deltaxml:deltaV2="Original=Anna=Chris" deltaxml:edit-type="delete">
<deltaxml:text deltaxml:deltaV2="Original=Anna=Chris">quick</deltaxml:text>
</deltaxml:textGroup> brown fox jumps over the lazy dog.</p>
A complex deletion
Ben deletes quick and Chris changes it to fast:
<p deltaxml:deltaV2="Original=Anna!=Ben!=Chris">The
<deltaxml:textGroup deltaxml:deltaV2="Original=Anna!=Chris" deltaxml:edit-type="delete">
<deltaxml:text deltaxml:deltaV2="Original=Anna">quick</deltaxml:text>
<deltaxml:text deltaxml:deltaV2="Chris">fast</deltaxml:text>
</deltaxml:textGroup> brown fox jumps over the lazy dog.</p>
A simple addition
Chris adds the word very:
<p deltaxml:deltaV2="Original=Anna=Ben!=Chris">The
<deltaxml:textGroup deltaxml:deltaV2="Chris" deltaxml:edit-type="add">
<deltaxml:text deltaxml:deltaV2="Chris">very </deltaxml:text>
</deltaxml:textGroup>quick brown fox jumps over the lazy dog.</p>
A simple modification
Chris changes quick to fast:
<p deltaxml:deltaV2="Original=Anna=Ben!=Chris">The
<deltaxml:textGroup deltaxml:deltaV2="Original=Anna=Ben!=Chris" deltaxml:edit-type="modify">
<deltaxml:text deltaxml:deltaV2="Original=Anna=Ben">quick</deltaxml:text>
<deltaxml:text deltaxml:deltaV2="Chris">fast</deltaxml:text>
</deltaxml:textGroup> brown fox jumps over the lazy dog.</p>
Notes
-
A simple change (in the context of rule-based processing) is one marked with an
addordeleteedit type where the deltaV2 attribute does not contain!=. -
A complex change has an add/delete edit type but also contains
!=in the deltaV2 attribute — these are typically resolved interactively. -
When categorising changes,
addanddeleteoverridemodify. -
Element adds/deletes: a simple add/delete has no descendant change in that subtree; a complex add/delete contains nested change.
Enabling the Merge Analysis
The concurrent merge analysis is performed as part of the output processing stage when the ResultType is set to ANALYZED_DELTAV2 (or a rule-resolved variant). When using the Java API, call setResultType(ConcurrentMergeResultType.ANALYZED_DELTAV2) before invoking extractAll() on the ConcurrentMerge object.