JavaSVN Home

org.tmatesoft.svn.core.wc
Class SVNLogClient

java.lang.Object
  extended byorg.tmatesoft.svn.core.wc.SVNBasicClient
      extended byorg.tmatesoft.svn.core.wc.SVNLogClient
All Implemented Interfaces:
ISVNEventHandler

public class SVNLogClient
extends SVNBasicClient

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:

JavaSVN Subversion
doLog()'svn log'
doList()'svn list'
doAnnotate()'svn blame'

Version:
1.1
Author:
TMate Software Ltd.

Nested Class Summary
 
Nested classes inherited from class org.tmatesoft.svn.core.wc.SVNBasicClient
SVNBasicClient.RepositoryReference, SVNBasicClient.SVNRepositoryLocation
 
Field Summary
 
Fields inherited from interface org.tmatesoft.svn.core.wc.ISVNEventHandler
UNKNOWN
 
Constructor Summary
  SVNLogClient(ISVNAuthenticationManager authManager, ISVNOptions options)
          Constructs and initializes an SVNLogClient object with the specified run-time configuration and authentication drivers.
protected SVNLogClient(ISVNRepositoryPool repositoryPool, ISVNOptions options)
           
 
Method Summary
 void doAnnotate(File path, SVNRevision pegRevision, SVNRevision startRevision, SVNRevision endRevision, ISVNAnnotateHandler handler)
          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.
 void doAnnotate(SVNURL url, SVNRevision pegRevision, SVNRevision startRevision, SVNRevision endRevision, ISVNAnnotateHandler handler)
          Obtains annotation information for each file text line from a repository and passes it to a provided annotation handler.
 void doAnnotate(SVNURL url, SVNRevision pegRevision, SVNRevision startRevision, SVNRevision endRevision, ISVNAnnotateHandler handler, String inputEncoding)
           
 void doList(File path, SVNRevision pegRevision, SVNRevision revision, boolean fetchLocks, boolean recursive, ISVNDirEntryHandler handler)
          Browses directory entries from a repository (using Working Copy paths to get corresponding URLs) and uses the provided dir entry handler to process them.
 void doList(File path, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNDirEntryHandler handler)
          Browses directory entries from a repository (using Working Copy paths to get corresponding URLs) and uses the provided dir entry handler to process them.
 void doList(SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean fetchLocks, boolean recursive, ISVNDirEntryHandler handler)
          Browses directory entries from a repository and uses the provided dir entry handler to process them.
 void doList(SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNDirEntryHandler handler)
          Browses directory entries from a repository and uses the provided dir entry handler to process them.
 void doLog(File[] paths, SVNRevision startRevision, SVNRevision endRevision, boolean stopOnCopy, boolean reportPaths, long limit, ISVNLogEntryHandler handler)
          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.
 void doLog(SVNURL url, String[] paths, SVNRevision pegRevision, SVNRevision startRevision, SVNRevision endRevision, boolean stopOnCopy, boolean reportPaths, long limit, ISVNLogEntryHandler handler)
          Gets commit log messages with other revision specific information from a repository and passes them to a log entry handler for processing.
 
Methods inherited from class org.tmatesoft.svn.core.wc.SVNBasicClient
checkCancelled, createRepository, createRepository, createRepository, createWCAccess, createWCAccess, dispatchEvent, dispatchEvent, getEventDispatcher, getLocations, getOptions, getRepositoryPool, getRevisionNumber, getURL, handleEvent, isIgnoreExternals, isLeaveConflictsUnresolved, setEventHandler, setEventPathPrefix, setIgnoreExternals, setLeaveConflictsUnresolved, sleepForTimeStamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVNLogClient

public SVNLogClient(ISVNAuthenticationManager authManager,
                    ISVNOptions options)
Constructs and initializes an SVNLogClient object with the specified run-time configuration and authentication drivers.

If options is null, then this SVNLogClient will be using a default run-time configuration driver which takes client-side settings from the default SVN's run-time configuration area but is not able to change those settings (read more on ISVNOptions and SVNWCUtil).

If authManager is null, then this SVNLogClient will be using a default authentication and network layers driver (see SVNWCUtil.createDefaultAuthenticationManager()) which uses server-side settings and auth storage from the default SVN's run-time configuration area (or system properties if that area is not found).

Parameters:
authManager - an authentication and network layers driver
options - a run-time configuration options driver

SVNLogClient

protected SVNLogClient(ISVNRepositoryPool repositoryPool,
                       ISVNOptions options)
Method Detail

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.

Parameters:
path - a WC file item to be annotated
pegRevision - a revision in which path is first looked up in the repository
startRevision - a revision for an operation to start from
endRevision - a revision for an operation to stop at
handler - a caller's handler to process annotation information
Throws:
SVNException - if startRevision > endRevision
See Also:
doAnnotate(SVNURL, SVNRevision, SVNRevision, SVNRevision, ISVNAnnotateHandler)

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.

Parameters:
url - a URL of a text file that is to be annotated
pegRevision - a revision in which path is first looked up in the repository
startRevision - a revision for an operation to start from
endRevision - a revision for an operation to stop at
handler - a caller's handler to process annotation information
Throws:
SVNException - if startRevision > endRevision
See Also:
doAnnotate(File, SVNRevision, SVNRevision, SVNRevision, ISVNAnnotateHandler)

doAnnotate

public void doAnnotate(SVNURL url,
                       SVNRevision pegRevision,
                       SVNRevision startRevision,
                       SVNRevision endRevision,
                       ISVNAnnotateHandler handler,
                       String inputEncoding)
                throws SVNException
Throws:
SVNException

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.

Parameters:
paths - an array of Working Copy paths, should not be null
startRevision - 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 processing
reportPaths - 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 processed
handler - a caller's log entry handler
Throws:
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
See Also:
doLog(SVNURL, String[], SVNRevision, SVNRevision, SVNRevision, boolean, boolean, long, ISVNLogEntryHandler)

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.

Parameters:
url - a target URL
paths - an array of paths relative to the target url
pegRevision - a revision in which url is first looked up
startRevision - 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 processing
reportPaths - 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 processed
handler - a caller's log entry handler
Throws:
SVNException
See Also:
doLog(File[], SVNRevision, SVNRevision, boolean, boolean, long, ISVNLogEntryHandler)

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.

Parameters:
path - a WC item to get its repository location
pegRevision - a revision in which the item's URL is first looked up
revision - a target revision
fetchLocks - true to fetch locks information from a repository
recursive - true to descend recursively (relevant for directories)
handler - a caller's directory entry handler (to process info on an entry)
Throws:
SVNException
See Also:
doList(SVNURL, SVNRevision, SVNRevision, boolean, ISVNDirEntryHandler)

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.

Parameters:
path - a WC item to get its repository location
pegRevision - a revision in which the item's URL is first looked up
revision - a target revision
recursive - true to descend recursively (relevant for directories)
handler - a caller's directory entry handler (to process info on an entry)
Throws:
SVNException
See Also:
doList(SVNURL, SVNRevision, SVNRevision, boolean, ISVNDirEntryHandler)

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.

Parameters:
url - a repository location to be "listed"
pegRevision - a revision in which the item's URL is first looked up
revision - a target revision
fetchLocks - true to fetch locks information from repository
recursive - true to descend recursively (relevant for directories)
handler - a caller's directory entry handler (to process info on an entry)
Throws:
SVNException
See Also:
doList(File, SVNRevision, SVNRevision, boolean, ISVNDirEntryHandler)

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.

Parameters:
url - a repository location to be "listed"
pegRevision - a revision in which the item's URL is first looked up
revision - a target revision
recursive - true to descend recursively (relevant for directories)
handler - a caller's directory entry handler (to process info on an entry)
Throws:
SVNException
See Also:
doList(File, SVNRevision, SVNRevision, boolean, ISVNDirEntryHandler)

JavaSVN Home

Copyright © 2004-2006 TMate Software Ltd. All Rights Reserved.