SVNKitRepositoryService extends AbstractRepositoryService { @Override public final String diffUnified(final SVNConnection connection, final PathRevision from, final PathRevision to, final Revision pegRevision, final String charset) throws SventonException { assertNotBinary(connection, from, to, pegRevision); try { final TextFile leftFile = getTextFile(connection, from.getPath(), getProperRevision(from.getRevision(), pegRevision), charset); final TextFile rightFile = getTextFile(connection, to.getPath(), getProperRevision(to.getRevision(), pegRevision), charset); return createUnifiedDiff(from, to, charset, leftFile, rightFile); } catch (final IOException ioex) { throw new DiffException("Unable to produce unified diff", ioex); } }  @Override LogEntry getLogEntry(final SVNConnection connection, final RepositoryName repositoryName, final long revision); @Override final List<LogEntry> getLogEntriesFromRepositoryRoot(final SVNConnection connection, final long fromRevision,
                                                              final long toRevision); @Override List<LogEntry> getLogEntries(final SVNConnection connection, final RepositoryName repositoryName,
                                      final long fromRevision, final long toRevision, final String path,
                                      final long limit, final boolean stopOnCopy, boolean includeChangedPaths); @Override final void export(final SVNConnection connection, final List<PathRevision> targets, final long pegRevision,
                           final File exportDirectory); @Override void getFileContents(final SVNConnection connection, final String path, final long revision,
                              final OutputStream output); @Override final Properties listProperties(final SVNConnection connection, final String path, final long revision); @Override final Long getLatestRevision(final SVNConnection connection); @Override final DirEntry.Kind getNodeKind(final SVNConnection connection, final String path, final long revision); @Override Map<String, DirEntryLock> getLocks(final SVNConnection connection, final String startPath, final boolean recursive); @SuppressWarnings({"unchecked"}) @Override final DirList list(final SVNConnection connection, final String path, final long revision); @Override final DirEntry getEntryInfo(final SVNConnection connection, final String path, final long revision); @SuppressWarnings({"unchecked"}) @Override final List<FileRevision> getFileRevisions(final SVNConnection connection, final String path, final long revision); @Override final String diffUnified(final SVNConnection connection, final PathRevision from, final PathRevision to,
                                  final Revision pegRevision, final String charset); @Override final List<DiffStatus> diffPaths(final SVNConnection connection, final PathRevision from, final PathRevision to); @Override final AnnotatedTextFile blame(final SVNConnection connection, final String path, final long revision,
                                       final String charset, final Colorer colorer); @Override Revision translateRevision(final SVNConnection connection, final Revision revision, final long headRevision); @Override List<Long> getRevisionsForPath(final SVNConnection connection, final String path, final long fromRevision,
                                        final long toRevision, final boolean stopOnCopy, final long limit);  }
@Test public void testDiffUnified() throws Exception { final TextFile leftFile = new TextFile("test left file contents" + NL); final TextFile rightFile = new TextFile("test right file contents" + NL); final SVNKitRepositoryService service = new SVNKitRepositoryService(); final PathRevision from = PathRevision.parse("/bug/code/try2/OrderDetailModel.java@91"); final PathRevision to = PathRevision.parse("/bug/code/try2/OrderDetailModel.java@90"); final String s = service.createUnifiedDiff(from, to, ENCODING, leftFile, rightFile); assertEquals("@@ -1 +1 @@" + NL + "-test left file contents" + NL + "+test right file contents", s.trim()); }