现在的位置: 首页 > 综合 > 正文

Class SVNCommitClient

2013年08月28日 ⁄ 综合 ⁄ 共 10946字 ⁄ 字号 评论关闭

java.lang.Object
  extended by org.tmatesoft.svn.core.wc.SVNBasicClient
      extended by 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,
boolean keepLocks, boolean force, boolean recursive)
 
          Deprecated. use doCollectCommitItems(File[],
boolean, boolean, SVNDepth, String[])
 instead
 SVNCommitPacket[] doCollectCommitItems(java.io.File[] paths,
boolean keepLocks, boolean force, boolean recursive, boolean combinePackets)
 
          Deprecated. use doCollectCommitItems(File[],
boolean, boolean, SVNDepth, boolean, String[])
 instead
 SVNCommitPacket[] doCollectCommitItems(java.io.File[] paths,
boolean keepLocks, boolean force, SVNDepth depth, boolean combinePackets,
java.lang.String[] changelists)
 
          Collects commit items (containing detailed information on each Working Copy item that was changed and need to be committed to the repository) into different SVNCommitPackets.
 SVNCommitPacket doCollectCommitItems(java.io.File[] paths,
boolean keepLocks, boolean force, SVNDepth depth, java.lang.String[] changelists)
 
          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,
boolean keepLocks, java.lang.String commitMessage, boolean force, boolean recursive)
 
          Deprecated. use doCommit(File[],
boolean, String, SVNProperties, String[], boolean, boolean, SVNDepth)
 instead
 SVNCommitInfo doCommit(java.io.File[] paths,
boolean keepLocks, java.lang.String commitMessage, SVNProperties revisionProperties,
java.lang.String[] changelists, boolean keepChangelist, boolean force, SVNDepth depth)

          Commits files or directories into repository.
 SVNCommitInfo[] doCommit(SVNCommitPacket[] commitPackets,
boolean keepLocks, boolean keepChangelist, java.lang.String commitMessage, SVNProperties revisionProperties)
 
          Commits files or directories into repository.
 SVNCommitInfo[] doCommit(SVNCommitPacket[] commitPackets,
boolean keepLocks, java.lang.String commitMessage)
 
          Committs local changes, made to the Working Copy items, to the repository.
 SVNCommitInfo doCommit(SVNCommitPacket commitPacket,
boolean keepLocks, boolean keepChangelist, java.lang.String commitMessage, SVNProperties revisionProperties)
 
          Commits files or directories into repository.
 SVNCommitInfo doCommit(SVNCommitPacket commitPacket,
boolean keepLocks, java.lang.String commitMessage)
 
          Committs local changes made to the Working Copy items to the repository.
 SVNCommitInfo doDelete(SVNURL[] urls,
java.lang.String commitMessage)
 
          Committs removing specified URL-paths from the repository.
 SVNCommitInfo doDelete(SVNURL[] urls,
java.lang.String commitMessage, SVNProperties revisionProperties)
 
          Deletes items from a repository.
 SVNCommitInfo doImport(java.io.File path, SVNURL dstURL,
java.lang.String commitMessage, boolean recursive)
 
          Deprecated. use doImport(File,
SVNURL, String, SVNProperties, boolean, boolean, SVNDepth)
 instead
 SVNCommitInfo doImport(java.io.File path, SVNURL dstURL,
java.lang.String commitMessage, boolean useGlobalIgnores, boolean recursive)
 
          Deprecated. use doImport(File,
SVNURL, String, SVNProperties, boolean, boolean, SVNDepth)
 instead
 SVNCommitInfo doImport(java.io.File path, SVNURL dstURL,
java.lang.String commitMessage, SVNProperties revisionProperties, boolean useGlobalIgnores,
boolean ignoreUnknownNodeTypes, SVNDepth depth)
 
          Imports file or directory path into repository directory dstURL at HEAD revision.
 SVNCommitInfo doMkDir(SVNURL[] urls,
java.lang.String commitMessage)
 
          Committs a creation of a new directory/directories in the repository.
 SVNCommitInfo doMkDir(SVNURL[] urls,
java.lang.String commitMessage, SVNProperties revisionProperties, boolean makeParents)
 
          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
dontWC17SupportgetDebugLoggetOperationsFactorygetOptionsgetPathListHandlergetReposRootgetReposRootisIgnoreExternalsisLeaveConflictsUnresolvedisWC17SupportedsetDebugLog,setEventHandlersetEventPathPrefixsetIgnoreExternalssetLeaveConflictsUnresolvedsetOptionssetPathListHandler

 

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 on ISVNOptions and SVNWCUtil).

If authManager is null, then this SVNCommitClient 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

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 on ISVNOptions and SVNWCUtil).

If repositoryPool is null, then SVNRepositoryFactory will
be used to create repository access objects.

Parameters:
repositoryPool - a repository pool object
options - 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)ISVNCommitHandlerDefaultSVNCommitHandler

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 removed
commitMessage - 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-nullrevisionProperties holds additional, custom revision properties (String names mapped to SVNPropertyValue 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 with SVNEventAction.COMMIT_COMPLETED event
action.

Parameters:
urls - repository urls to delete
commitMessage - commit log message
revisionProperties - custom revision properties
Returns:
information about the new committed revision
Throws:
SVNException - in the following cases:

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 created
commitMessage - 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

抱歉!评论已关闭.