The
SVNLogClient class is intended for such purposes as getting
revisions history, browsing repository entries and annotating file contents.
Here's a list of the
SVNLogClient's methods
matched against corresponing commands of the
SVN command line
client:
| SVNKit | Subversion |
| doLog() | 'svn log' |
| doList() | 'svn list' |
| doAnnotate() | 'svn blame' |
doAnnotate
public void doAnnotate(File path,
SVNRevision pegRevision,
SVNRevision startRevision,
SVNRevision endRevision,
boolean force,
ISVNAnnotateHandler handler)
throws SVNException Obtains annotation information for each file text line from a repository
(using a Working Copy path to get a corresponding URL) and passes it to a
provided annotation handler.
If
startRevision is invalid (for example,
startRevision = UNDEFINED) then
it's set to revision 1.
path - a WC file item to be annotatedpegRevision - a revision in which path is first looked up
in the repositorystartRevision - a revision for an operation to start fromendRevision - a revision for an operation to stop atforce - forces operation to run (all files to be treated as
text, no matter what SVNKit has inferred from the mime-type
property)handler - a caller's handler to process annotation information
doAnnotate
public void doAnnotate(File path,
SVNRevision pegRevision,
SVNRevision startRevision,
SVNRevision endRevision,
ISVNAnnotateHandler handler)
throws SVNException Obtains annotation information for each file text line from a repository
(using a Working Copy path to get a corresponding URL) and passes it to a
provided annotation handler.
If
startRevision is invalid (for example,
startRevision = UNDEFINED) then
it's set to revision 1.
Calling this method is equivalent to
doAnnotate(path, pegRevision, startRevision, endRevision, false, handler).
path - a WC file item to be annotatedpegRevision - a revision in which path is first looked up
in the repositorystartRevision - a revision for an operation to start fromendRevision - a revision for an operation to stop athandler - a caller's handler to process annotation information
doAnnotate
public void doAnnotate(SVNURL url,
SVNRevision pegRevision,
SVNRevision startRevision,
SVNRevision endRevision,
boolean force,
ISVNAnnotateHandler handler,
String inputEncoding)
throws SVNException Obtains annotation information for each file text line from a repository
and passes it to a provided annotation handler.
If
startRevision is invalid (for example,
startRevision = UNDEFINED) then
it's set to revision 1.
If
inputEncoding is
null then
"file.encoding" system property is used.
url - a URL of a text file that is to be annotatedpegRevision - a revision in which path is first looked up
in the repositorystartRevision - a revision for an operation to start fromendRevision - a revision for an operation to stop atforce - forces operation to run (all files to be treated as
text, no matter what SVNKit has inferred from the mime-type
property)handler - a caller's handler to process annotation informationinputEncoding - a desired character set (encoding) of text lines
doAnnotate
public void doAnnotate(SVNURL url,
SVNRevision pegRevision,
SVNRevision startRevision,
SVNRevision endRevision,
ISVNAnnotateHandler handler)
throws SVNException Obtains annotation information for each file text line from a repository
and passes it to a provided annotation handler.
If
startRevision is invalid (for example,
startRevision = UNDEFINED) then
it's set to revision 1.
Calling this method is equivalent to
doAnnotate(url, pegRevision, startRevision, endRevision, handler, null).
url - a URL of a text file that is to be annotatedpegRevision - a revision in which path is first looked up
in the repositorystartRevision - a revision for an operation to start fromendRevision - a revision for an operation to stop athandler - a caller's handler to process annotation information
doAnnotate
public void doAnnotate(SVNURL url,
SVNRevision pegRevision,
SVNRevision startRevision,
SVNRevision endRevision,
ISVNAnnotateHandler handler,
String inputEncoding)
throws SVNException Obtains annotation information for each file text line from a repository
and passes it to a provided annotation handler.
If
startRevision is invalid (for example,
startRevision = UNDEFINED) then
it's set to revision 1.
Calling this method is equivalent to
doAnnotate(url, pegRevision, startRevision, endRevision, false, handler, inputEncoding).
url - a URL of a text file that is to be annotatedpegRevision - a revision in which path is first looked up
in the repositorystartRevision - a revision for an operation to start fromendRevision - a revision for an operation to stop athandler - a caller's handler to process annotation informationinputEncoding - a desired character set (encoding) of text lines
doList
public void doList(File path,
SVNRevision pegRevision,
SVNRevision revision,
boolean fetchLocks,
boolean recursive,
ISVNDirEntryHandler handler)
throws SVNException Browses directory entries from a repository (using Working
Copy paths to get corresponding URLs) and uses the provided dir
entry handler to process them.
On every entry that this method stops it gets some useful entry
information which is packed into an
SVNDirEntry
object and passed to the
handler's
handleDirEntry() method.
path - a WC item to get its repository locationpegRevision - a revision in which the item's URL is first looked uprevision - a target revisionfetchLocks - true to fetch locks
information from a repositoryrecursive - true to
descend recursively (relevant for directories)handler - a caller's directory entry handler (to process
info on an entry)
doList
public void doList(File path,
SVNRevision pegRevision,
SVNRevision revision,
boolean recursive,
ISVNDirEntryHandler handler)
throws SVNException Browses directory entries from a repository (using Working
Copy paths to get corresponding URLs) and uses the provided dir
entry handler to process them.
On every entry that this method stops it gets some useful entry
information which is packed into an
SVNDirEntry
object and passed to the
handler's
handleDirEntry() method.
path - a WC item to get its repository locationpegRevision - a revision in which the item's URL is first looked uprevision - a target revisionrecursive - true to
descend recursively (relevant for directories)handler - a caller's directory entry handler (to process
info on an entry)
doList
public void doList(SVNURL url,
SVNRevision pegRevision,
SVNRevision revision,
boolean fetchLocks,
boolean recursive,
ISVNDirEntryHandler handler)
throws SVNException Browses directory entries from a repository and uses the provided
dir entry handler to process them. This method is
especially useful when having no Working Copy.
On every entry that this method stops it gets some useful entry
information which is packed into an
SVNDirEntry
object and passed to the
handler's
handleDirEntry() method.
url - a repository location to be "listed"pegRevision - a revision in which the item's URL is first looked uprevision - a target revisionfetchLocks - true to
fetch locks information from repositoryrecursive - true to
descend recursively (relevant for directories)handler - a caller's directory entry handler (to process
info on an entry)
doList
public void doList(SVNURL url,
SVNRevision pegRevision,
SVNRevision revision,
boolean recursive,
ISVNDirEntryHandler handler)
throws SVNException Browses directory entries from a repository and uses the provided
dir entry handler to process them. This method is
especially useful when having no Working Copy.
On every entry that this method stops it gets some useful entry
information which is packed into an
SVNDirEntry
object and passed to the
handler's
handleDirEntry() method.
url - a repository location to be "listed"pegRevision - a revision in which the item's URL is first looked uprevision - a target revisionrecursive - true to
descend recursively (relevant for directories)handler - a caller's directory entry handler (to process
info on an entry)
doLog
public void doLog(File[] paths,
SVNRevision startRevision,
SVNRevision endRevision,
boolean stopOnCopy,
boolean reportPaths,
long limit,
ISVNLogEntryHandler handler)
throws SVNException Gets commit log messages with other revision specific
information from a repository (using Working Copy paths to get
corresponding URLs) and passes them to a log entry handler for
processing. Useful for observing the history of affected paths,
author, date and log comments information per revision.
If
paths is not empty then the result will be restricted
to only those revisions from the specified range [
startRevision,
endRevision],
where
paths were changed in the repository. To cover the
entire range set
paths just to an empty array:
logClient.doLog(new File[]{""},..);
If
startRevision is valid but
endRevision is
not (for example,
endRevision = UNDEFINED)
then
endRevision is equated to
startRevision.
If
startRevision is invalid (for example,
UNDEFINED)
then it's equated to
BASE. In this case if
endRevision is
also invalid, then
endRevision is set to revision 0.
Calling this method is equivalent to
doLog(paths, SVNRevision.UNDEFINED, startRevision, endRevision, stopOnCopy, reportPaths, limit, handler).
paths - an array of Working Copy paths,
should not be nullstartRevision - a revision for an operation to start from (including
this revision)endRevision - a revision for an operation to stop at (including
this revision)stopOnCopy - true not to cross
copies while traversing history, otherwise copies history
will be also included into processingreportPaths - true to report
of all changed paths for every revision being processed
(those paths will be available by calling
SVNLogEntry.getChangedPaths())limit - a maximum number of log entries to be processedhandler - a caller's log entry handler
SVNException - if one of the following is true:
- a path is not under version control
- can not obtain a URL of a WC path - there's no such
entry in the Working Copy
paths contain entries that belong to
different repositories
doLog
public void doLog(File[] paths,
SVNRevision pegRevision,
SVNRevision startRevision,
SVNRevision endRevision,
boolean stopOnCopy,
boolean reportPaths,
long limit,
ISVNLogEntryHandler handler)
throws SVNException Gets commit log messages with other revision specific
information from a repository (using Working Copy paths to get
corresponding URLs) and passes them to a log entry handler for
processing. Useful for observing the history of affected paths,
author, date and log comments information per revision.
If
paths is not empty then the result will be restricted
to only those revisions from the specified range [
startRevision,
endRevision],
where
paths were changed in the repository. To cover the
entire range set
paths just to an empty array:
logClient.doLog(new File[]{""},..);
If
startRevision is valid but
endRevision is
not (for example,
endRevision = UNDEFINED)
then
endRevision is equated to
startRevision.
If
startRevision is invalid (for example,
UNDEFINED)
then it's equated to
BASE. In this case if
endRevision is
also invalid, then
endRevision is set to revision 0.
paths - an array of Working Copy paths,
should not be nullpegRevision - a revision in which path is first looked up
in the repositorystartRevision - a revision for an operation to start from (including
this revision)endRevision - a revision for an operation to stop at (including
this revision)stopOnCopy - true not to cross
copies while traversing history, otherwise copies history
will be also included into processingreportPaths - true to report
of all changed paths for every revision being processed
(those paths will be available by calling
SVNLogEntry.getChangedPaths())limit - a maximum number of log entries to be processedhandler - a caller's log entry handler
SVNException - if one of the following is true:
- a path is not under version control
- can not obtain a URL of a WC path - there's no such
entry in the Working Copy
paths contain entries that belong to
different repositories
doLog
public void doLog(SVNURL url,
String[] paths,
SVNRevision pegRevision,
SVNRevision startRevision,
SVNRevision endRevision,
boolean stopOnCopy,
boolean reportPaths,
long limit,
ISVNLogEntryHandler handler)
throws SVNException Gets commit log messages with other revision specific
information from a repository and passes them to a log entry
handler for processing. Useful for observing the history of
affected paths, author, date and log comments information per revision.
If
paths is
null or empty
then
url is the target path that is used to restrict the result
to only those revisions from the specified range [
startRevision,
endRevision],
where
url was changed in the repository. Otherwise if
paths is
not empty then
url is the root for all those paths (that are
used for restricting the result).
If
startRevision is valid but
endRevision is
not (for example,
endRevision = UNDEFINED)
then
endRevision is equated to
startRevision.
If
startRevision is invalid (for example,
UNDEFINED)
then it's equated to
HEAD. In this case if
endRevision is
also invalid, then
endRevision is set to revision 0.
url - a target URLpaths - an array of paths relative to the target
urlpegRevision - a revision in which url is first looked upstartRevision - a revision for an operation to start from (including
this revision)endRevision - a revision for an operation to stop at (including
this revision)stopOnCopy - true not to cross
copies while traversing history, otherwise copies history
will be also included into processingreportPaths - true to report
of all changed paths for every revision being processed
(those paths will be available by calling
SVNLogEntry.getChangedPaths())limit - a maximum number of log entries to be processedhandler - a caller's log entry handler
- 1.1, new in Subversion 1.4
getDiffOptions
public SVNDiffOptions getDiffOptions()
Gets the diff options that are used in annotate operations
by this client. Creates a new one if none was used before.
setDiffOptions
public void setDiffOptions(SVNDiffOptions diffOptions)
Sets diff options for this client to use in annotate operations.
diffOptions - diff options object