Add file content merge algorithm
commit6d930cd572463ede104126ac68a84bc283a1aa3d
authorChristian Halstrick <christian.halstrick@sap.com>
Thu, 3 Dec 2009 15:36:14 +0000 (3 16:36 +0100)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 6 Jan 2010 17:49:24 +0000 (6 09:49 -0800)
treef72863c89518b5adbf7935fe752e5149d9cc317d
parentb0772d7a5c74d68a31697ebc971438faa7a132f5
Add file content merge algorithm

Adds the file content merge alorithm and tests for merge to jgit.
The merge algorithm:

- Gets as input parameters the common base, the two new contents
  called "ours" and "theirs".

- Computes the Edits from base to ours and from base to theirs with
  the help of MyersDiff.

- Iterates over the edits.

- Independent edits from ours or from theirs will just be applied
  to the result.

- For conflicting edits we first harmonize the ranges of the edits
  so that in the end we have exactly two edits starting and ending
  at the same points in the common base. Then we write the two
  conclicting contents into the result stream.

Change-Id: I411862393e7bf416b6f33ca55ec5af608ff4663
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
[sp: Fixed up two awkard comments in documentation.]
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeAlgorithmTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeAlgorithm.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeChunk.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeFormatter.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeResult.java [new file with mode: 0644]