Since SVNAnnotationGenerator implements ISVNFileRevisionHandler, it is merely passed to a {@link org.tmatesoft.svn.core.io.SVNRepository#getFileRevisions(String,long,long,ISVNFileRevisionHandler) getFileRevisions()} method of SVNRepository. After that you handle the resultant annotated file line-by-line providing an ISVNAnnotateHandler implementation to the {@link #reportAnnotations(ISVNAnnotateHandler,String) reportAnnotations()}method:
import org.tmatesoft.svn.core.SVNAnnotationGenerator; import org.tmatesoft.svn.core.io.SVNRepositoryFactory; import org.tmatesoft.svn.core.io.SVNRepository; import org.tmatesoft.svn.core.wc.SVNAnnotateHandler; ... File tmpFile; SVNRepository repos; ISVNAnnotateHandler annotateHandler; ISVNEventHandler cancelHandler; long startRev = 0; long endRev = 150; ... SVNAnnotationGenerator generator = new SVNAnnotationGenerator(path, tmpFile, cancelHandler); try { repos.getFileRevisions("", startRev, endRev, generator); generator.reportAnnotations(annotateHandler, null); } finally { generator.dispose(); } ...@version 1.3 @since 1.2 @author TMate Software Ltd.
|
|