SVNKit Home

## org.tmatesoft.svn.core.wc
Class SVNLogClient

    java.lang.Object
      org.tmatesoft.svn.core.wc.SVNBasicClient
          org.tmatesoft.svn.core.wc.SVNLogClient

All Implemented Interfaces:
  ISVNCanceller, 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:

SVNKit | Subversion
doLog() | 'svn log'
doList() | 'svn list'
doAnnotate() | 'svn blame'

Version:
  1.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`

Fields inherited from interface org.tmatesoft.svn.core.ISVNCanceller
`NULL`

Constructor Summary
`SVNLogClient(ISVNAuthenticationManager authManager, ISVNOptions options)` Constructs and initializes an SVNLogClient object with the specified run-time configuration and authentication drivers.
`SVNLogClient(ISVNRepositoryPool repositoryPool, ISVNOptions options)`

Method Summary
`void` `doAnnotate(File path, SVNRevision pegRevision, SVNRevision startRevision, SVNRevision endRevision, boolean force, 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(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, boolean force, ISVNAnnotateHandler handler, String inputEncoding)` 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)` 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)` Obtains annotation information for each file text line from a repository and passes it to a provided annotation handler.
`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(File[] 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 (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.
`SVNDiffOptions` `getDiffOptions()` Gets the diff options that are used in annotate operations by this client.
`void` `setDiffOptions(SVNDiffOptions diffOptions)` Sets diff options for this client to use in annotate operations.

Methods inherited from class org.tmatesoft.svn.core.wc.SVNBasicClient

`checkCancelled, createRepository, createRepository, createRepository, createWCAccess, createWCAccess, dispatchEvent, dispatchEvent, getDebugLog, getEventDispatcher, getLocations, getOptions, getRepositoryPool, getRevisionNumber, getURL, handleEvent, isIgnoreExternals, isLeaveConflictsUnresolved, setDebugLog, setEventHandler, setEventPathPrefix, setIgnoreExternals, setLeaveConflictsUnresolved, setOptions, 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

    public SVNLogClient(ISVNRepositoryPool repositoryPool,
                        ISVNOptions options)

Method Detail

### setDiffOptions

    public void setDiffOptions(SVNDiffOptions diffOptions)

  Sets diff options for this client to use in annotate operations.

  Parameters:
    `diffOptions` - diff options object

### 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.

  Returns:
    diff options

### 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)`.

  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(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.

  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
    `force` - 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
  Throws:
    `SVNException`
  Since:
    1.1

### 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)`.

  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

  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)`.

  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
    `inputEncoding` - a desired character set (encoding) of text lines
  Throws:
    `SVNException`

### 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.

  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
    `force` - 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
    `inputEncoding` - a desired character set (encoding) of text lines
  Throws:
    `SVNException`
  Since:
    1.1

### 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)`.

  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(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.

  Parameters:
    `paths` - an array of Working Copy paths, should not be null
    `pegRevision` - a revision in which `path` is first looked up in the repository
    `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

### 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`
  Since:
    1.1, new in Subversion 1.4
  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)`

SVNKit Home

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