From 67263e2056108e471d684c3cef9e719724b51220 Mon Sep 17 00:00:00 2001 From: Shawn O. Pearce Date: Thu, 2 Sep 2010 12:53:27 -0700 Subject: Refactor diff sequence API Instead of making the sequence itself responsible for the equivalence function, use an external function that is supplied by the caller. This cleans up the code because we now say cmp.equals(a, ai, b, bi) instead of a.equals(ai, b, bi). This refactoring also removes the odd concept of creating different types of sequences to have different behaviors for whitespace ignoring. Instead DiffComparator now supports singleton functions that apply a particular equivalence algorithm to a type of sequence. Change-Id: I559f494d81cdc6f06bfb4208f60780c0ae251df9 Signed-off-by: Shawn O. Pearce --- org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'org.eclipse.jgit.iplog') diff --git a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java index 433d4338df..5013eb6b8a 100644 --- a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java +++ b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java @@ -77,6 +77,7 @@ import org.eclipse.jgit.diff.Edit; import org.eclipse.jgit.diff.EditList; import org.eclipse.jgit.diff.MyersDiff; import org.eclipse.jgit.diff.RawText; +import org.eclipse.jgit.diff.RawTextComparator; import org.eclipse.jgit.errors.ConfigInvalidException; import org.eclipse.jgit.iplog.Committer.ActiveRange; import org.eclipse.jgit.lib.BlobBasedConfig; @@ -383,7 +384,8 @@ public class IpLogGenerator { else oldImage = new byte[0]; - EditList edits = new MyersDiff(new RawText(oldImage), + EditList edits = new MyersDiff( + RawTextComparator.DEFAULT, new RawText(oldImage), new RawText(openBlob(1))).getEdits(); for (Edit e : edits) addedLines += e.getEndB() - e.getBeginB(); -- cgit v1.2.3