java.lang.Object org.tmatesoft.svn.core.wc.SVNBasicClient org.tmatesoft.svn.core.wc.SVNCommitClient
-
public class SVNCommitClient
- extends SVNBasicClient
The SVNCommitClient class provides methods to perform operations that relate to committing changes to an SVN repository. These operations are similar to respective commands of the native SVN command line client and include ones which operate
on working copy items as well as ones that operate only on a repository.
Here's a list of the SVNCommitClient's commit-related methods matched against corresponing commands of the SVN command line client:
SVNKit | Subversion |
doCommit() | 'svn commit' |
doImport() | 'svn import' |
doDelete() | 'svn delete URL' |
doMkDir() | 'svn mkdir URL' |
- Since:
- 1.2
- See Also:
- Examples
Constructor Summary | |
---|---|
SVNCommitClient(ISVNAuthenticationManager authManager, ISVNOptions options) Constructs and initializes an SVNCommitClient object with the specified run-time configuration and authentication drivers. |
|
SVNCommitClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) Constructs and initializes an SVNCommitClient object with the specified run-time configuration and repository pool object. |
Method Summary | |
---|---|
SVNCommitPacket |
doCollectCommitItems(java.io.File[] paths, Deprecated. use doCollectCommitItems(File[], instead |
SVNCommitPacket[] |
doCollectCommitItems(java.io.File[] paths, Deprecated. use doCollectCommitItems(File[], instead |
SVNCommitPacket[] |
doCollectCommitItems(java.io.File[] paths, Collects commit items (containing detailed information on each Working Copy item that was changed and need to be committed to the repository) into different SVNCommitPacket s. |
SVNCommitPacket |
doCollectCommitItems(java.io.File[] paths, Collects commit items (containing detailed information on each Working Copy item that contains changes and need to be committed to the repository) into a single SVNCommitPacket . |
SVNCommitInfo |
doCommit(java.io.File[] paths, Deprecated. use doCommit(File[], instead |
SVNCommitInfo |
doCommit(java.io.File[] paths, Commits files or directories into repository. |
SVNCommitInfo[] |
doCommit(SVNCommitPacket[] commitPackets, Commits files or directories into repository. |
SVNCommitInfo[] |
doCommit(SVNCommitPacket[] commitPackets, Committs local changes, made to the Working Copy items, to the repository. |
SVNCommitInfo |
doCommit(SVNCommitPacket commitPacket, Commits files or directories into repository. |
SVNCommitInfo |
doCommit(SVNCommitPacket commitPacket, Committs local changes made to the Working Copy items to the repository. |
SVNCommitInfo |
doDelete(SVNURL[] urls, Committs removing specified URL-paths from the repository. |
SVNCommitInfo |
doDelete(SVNURL[] urls, Deletes items from a repository. |
SVNCommitInfo |
doImport(java.io.File path, SVNURL dstURL, Deprecated. use doImport(File, instead |
SVNCommitInfo |
doImport(java.io.File path, SVNURL dstURL, Deprecated. use doImport(File, instead |
SVNCommitInfo |
doImport(java.io.File path, SVNURL dstURL, Imports file or directory path into repository directory dstURL at HEAD revision. |
SVNCommitInfo |
doMkDir(SVNURL[] urls, Committs a creation of a new directory/directories in the repository. |
SVNCommitInfo |
doMkDir(SVNURL[] urls, Creates directory(ies) in a repository. |
ISVNCommitHandler |
getCommitHandler() Returns the specified commit handler (if set) being in use or a default one (DefaultSVNCommitHandler) if no special implementations of ISVNCommitHandler were previously provided. |
ISVNCommitParameters |
getCommitParameters() Returns commit parameters. |
void |
setCommitHander(ISVNCommitHandler handler) Deprecated. use setCommitHandler(ISVNCommitHandler) instead |
void |
setCommitHandler(ISVNCommitHandler handler) Sets an implementation of ISVNCommitHandler to the commit handler that will be used during commit operations to handle commit log messages. |
void |
setCommitParameters(ISVNCommitParameters parameters) Sets commit parameters to use. |
Methods inherited from class org.tmatesoft.svn.core.wc.SVNBasicClient |
---|
dontWC17Support, getDebugLog, getOperationsFactory, getOptions, getPathListHandler, getReposRoot, getReposRoot, isIgnoreExternals, isLeaveConflictsUnresolved, isWC17Supported, setDebugLog,setEventHandler, setEventPathPrefix, setIgnoreExternals, setLeaveConflictsUnresolved, setOptions, setPathListHandler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
SVNCommitClient
public SVNCommitClient(ISVNAuthenticationManager authManager, ISVNOptions options)
- Constructs and initializes an SVNCommitClient object with the specified run-time configuration and authentication drivers.
If
options
is null, then this SVNCommitClient 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 onISVNOptions
andSVNWCUtil
).If
authManager
is null, then this SVNCommitClient will be using a default authentication and network layers
driver (seeSVNWCUtil.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 driveroptions
- a run-time configuration options driver
SVNCommitClient
public SVNCommitClient(ISVNRepositoryPool repositoryPool, ISVNOptions options)
- Constructs and initializes an SVNCommitClient object with the specified run-time configuration and repository pool object.
If
options
is null, then this SVNCommitClient 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 onISVNOptions
andSVNWCUtil
).If
repositoryPool
is null, thenSVNRepositoryFactory
will
be used to createrepository access objects
.- Parameters:
repositoryPool
- a repository pool objectoptions
- a run-time configuration options driver
Method Detail |
---|
setCommitHander
public void setCommitHander(ISVNCommitHandler handler)
- Deprecated. use
setCommitHandler(ISVNCommitHandler)
instead -
- Parameters:
handler
-
setCommitHandler
public void setCommitHandler(ISVNCommitHandler handler)
- Sets an implementation of ISVNCommitHandler to the commit handler that will be used during commit operations to handle commit log messages. The handler will receive a clien's log message and items (represented asSVNCommitItem objects)
that will be committed. Depending on implementor's aims the initial log message can be modified (or something else) and returned back.If using SVNCommitClient without specifying any commit handler then a default one will be used -
DefaultSVNCommitHandler
. -
- Parameters:
handler
- an implementor's handler that will be used to handle commit log messages- See Also:
getCommitHandler()
,ISVNCommitHandler
getCommitHandler
public ISVNCommitHandler getCommitHandler()
- Returns the specified commit handler (if set) being in use or a default one (DefaultSVNCommitHandler) if no special implementations of ISVNCommitHandler were previously provided.
-
- Returns:
- the commit handler being in use or a default one
- See Also:
setCommitHander(ISVNCommitHandler)
,ISVNCommitHandler
,DefaultSVNCommitHandler
setCommitParameters
public void setCommitParameters(ISVNCommitParameters parameters)
- Sets commit parameters to use.
When no parameters are set
default
ones
are used. -
- Parameters:
parameters
- commit parameters- See Also:
getCommitParameters()
getCommitParameters
public ISVNCommitParameters getCommitParameters()
- Returns commit parameters.
If no user parameters were previously specified, once creates and returns
default
ones. -
- Returns:
- commit parameters
- See Also:
setCommitParameters(ISVNCommitParameters)
doDelete
public SVNCommitInfo doDelete(SVNURL[] urls, java.lang.String commitMessage) throws SVNException
- Committs removing specified URL-paths from the repository. This call is equivalent to
doDelete(urls, commitMessage, null)
. -
- Parameters:
urls
- an array containing URL-strings that represent repository locations to be removedcommitMessage
- a string to be a commit log message- Returns:
- information on a new revision as the result of the commit
- Throws:
SVNException
- if one of the following is true:- a URL does not exist
- probably some of URLs refer to different repositories
- See Also:
doDelete(SVNURL[],
String, SVNProperties)
doDelete
public SVNCommitInfo doDelete(SVNURL[] urls, java.lang.String commitMessage, SVNProperties revisionProperties) throws SVNException
- Deletes items from a repository.
If non-null,
revisionProperties
holds additional, custom revision properties (String
names mapped toSVNPropertyValue
values)
to be set on the new revision. This table cannot contain any standard Subversion properties.Commit handler
will be asked for a commit log message.If the caller's
event handler
is not null and
if the commit succeeds, the handler will be called withSVNEventAction.COMMIT_COMPLETED
event
action. -
- Parameters:
urls
- repository urls to deletecommitMessage
- commit log messagerevisionProperties
- custom revision properties- Returns:
- information about the new committed revision
- Throws:
SVNException
- in the following cases:- exception with
SVNErrorCode.RA_ILLEGAL_URL
error code - if cannot compute common
root url forurls
- exception with
SVNErrorCode.FS_NOT_FOUND
error code - if some ofurls
does
not exist
- exception with
- Since:
- 1.2.0, SVN 1.5.0
doMkDir
public SVNCommitInfo doMkDir(SVNURL[] urls, java.lang.String commitMessage) throws SVNException
- Committs a creation of a new directory/directories in the repository.
-
- Parameters:
urls
- an array containing URL-strings that represent new repository locations to be createdcommitMessage
- a string to be a commit log message- Returns:
- information on a new revision as the result of the commit
- Throws:
SVNException
- if some of URLs refer to different repositories
doMkDir
public SVNCommitInfo doMkDir(SVNURL[] urls,
java.lang.String commitMessage,
SVNProperties revisionProperties,
boolean makeParents)
throws