A method and system provides an improved representation of merge conflicts
in a three-way merge operation of three sequences: Original, Version1,
and Version2. A merge program first compares the three sequences to
identify a list of difference chunks of elements between the Original and
Version1, and a list of difference chunks between the Original and
Version2. From the two sets of difference chunks, the merge program
creates an annotated list of chunks. Each chunk in the annotated list is
identified by a conflict flag that indicates whether the chunk is a part
of a conflict and if it is, what sequence(s) being merged it belongs to.
A merged document is then constructed based on the annotated list of
chunks, with the chunks identified in the merged document with conflict
markers for viewing by a user.