org.tmatesoft.svn.core
Class SVNAnnotationGenerator
- ISVNDeltaConsumer, ISVNFileRevisionHandler
public class SVNAnnotationGenerator
The
SVNAnnotationGenerator class is used to annotate files - that is
to place author and revision information in-line for the specified
file.
Since
SVNAnnotationGenerator implements
ISVNFileRevisionHandler,
it is merely passed to a
getFileRevisions()
method of
SVNRepository. After that you handle the resultant annotated
file line-by-line providing an
ISVNAnnotateHandler implementation to the
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();
}
...
SVNAnnotationGenerator(String path, File tmpDirectory, long startRevision, boolean force, ISVNEventHandler cancelBaton)- Constructs an annotation generator object.
|
SVNAnnotationGenerator(String path, File tmpDirectory, long startRevision, boolean force, SVNDiffOptions diffOptions, ISVNEventHandler cancelBaton)- Constructs an annotation generator object.
|
SVNAnnotationGenerator(String path, File tmpDirectory, long startRevision, ISVNEventHandler cancelBaton)- Constructs an annotation generator object.
|
SVNAnnotationGenerator
public SVNAnnotationGenerator(String path,
File tmpDirectory,
long startRevision,
boolean force,
ISVNEventHandler cancelBaton) Constructs an annotation generator object.
path - a file path (relative to a repository location)tmpDirectory - a revision to stop atstartRevision - a start revision to begin annotation withforce - forces binary files processingcancelBaton - a baton which is used to check if an operation
is cancelled
SVNAnnotationGenerator
public SVNAnnotationGenerator(String path,
File tmpDirectory,
long startRevision,
boolean force,
SVNDiffOptions diffOptions,
ISVNEventHandler cancelBaton) Constructs an annotation generator object.
path - a file path (relative to a repository location)tmpDirectory - a revision to stop atstartRevision - a start revision to begin annotation withforce - forces binary files processingdiffOptions - diff optionscancelBaton - a baton which is used to check if an operation
is cancelled
SVNAnnotationGenerator
public SVNAnnotationGenerator(String path,
File tmpDirectory,
long startRevision,
ISVNEventHandler cancelBaton) Constructs an annotation generator object.
This constructor is equivalent to
SVNAnnotationGenerator(path, tmpDirectory, startRevision, false, cancelBaton).
path - a file path (relative to a repository location)tmpDirectory - a revision to stop atstartRevision - a start revision to begin annotation withcancelBaton - a baton which is used to check if an operation
is cancelled
applyTextDelta
public void applyTextDelta(String token,
String baseChecksum)
throws SVNException Starts applying text delta(s) to an opened file.
- applyTextDelta in interface ISVNDeltaConsumer
baseChecksum - an MD5 checksum for the base file contents (before the
file is changed)
SVNException - if the calculated base file checksum didn't match the expected
baseChecksum
dispose
public void dispose()
Finalizes an annotation operation releasing resources involved
by this generator. Should be called after
reportAnnotations().
reportAnnotations
public void reportAnnotations(ISVNAnnotateHandler handler,
String inputEncoding)
throws SVNException Dispatches file lines along with author & revision info to the provided
annotation handler.
If
inputEncoding is
null then
"file.encoding" system property is used.
handler - an annotation handler that processes file lines with
author & revision infoinputEncoding - a desired character set (encoding) of text lines
textDeltaChunk
public OutputStream textDeltaChunk(String token,
SVNDiffWindow diffWindow)
throws SVNException Collects a next delta chunk.
The return type is nomore relevant and is left only for backward compatibility.
So, the return value may be just
null. Otherwise
if it's not
null, the stream
will be immediately closed.
If there are more than one windows for the file,
this method is called several times.
- textDeltaChunk in interface ISVNDeltaConsumer
diffWindow - a next diff window
Copyright © 2004-2006 TMate Software Ltd. All Rights Reserved.