diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-09-02 12:53:27 -0700 |
---|---|---|
committer | Chris Aniszczyk <caniszczyk@gmail.com> | 2010-09-06 21:37:11 -0500 |
commit | 67263e2056108e471d684c3cef9e719724b51220 (patch) | |
tree | e4ea7623e4b0884b542c77167ab456e3643eb5ed /org.eclipse.jgit.iplog | |
parent | 18aadc826dae7c6308c2a6c68d48ab75c8dd9b6d (diff) | |
download | jgit-67263e2056108e471d684c3cef9e719724b51220.tar.gz jgit-67263e2056108e471d684c3cef9e719724b51220.zip |
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 <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.iplog')
-rw-r--r-- | org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java | 4 |
1 files changed, 3 insertions, 1 deletions
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<RawText>( + RawTextComparator.DEFAULT, new RawText(oldImage), new RawText(openBlob(1))).getEdits(); for (Edit e : edits) addedLines += e.getEndB() - e.getBeginB(); |