Class SVNCommitClient16
- java.lang.Object
-
- org.tmatesoft.svn.core.internal.wc16.SVNBasicDelegate
-
- org.tmatesoft.svn.core.internal.wc16.SVNCommitClient16
-
- All Implemented Interfaces:
ISVNCanceller
,ISVNEventHandler
public class SVNCommitClient16 extends SVNBasicDelegate
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
- Version:
- 1.3
- See Also:
- Examples
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.tmatesoft.svn.core.internal.wc16.SVNBasicDelegate
SVNBasicDelegate.RepositoryReference, SVNBasicDelegate.SVNRepositoryLocation
-
-
Field Summary
Fields Modifier and Type Field Description private ISVNCommitHandler
myCommitHandler
private ISVNCommitParameters
myCommitParameters
-
Fields inherited from interface org.tmatesoft.svn.core.ISVNCanceller
NULL
-
Fields inherited from interface org.tmatesoft.svn.core.wc.ISVNEventHandler
UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description SVNCommitClient16(ISVNAuthenticationManager authManager, ISVNOptions options)
Constructs and initializes an SVNCommitClient object with the specified run-time configuration and authentication drivers.SVNCommitClient16(ISVNRepositoryPool repositoryPool, ISVNOptions options)
Constructs and initializes an SVNCommitClient object with the specified run-time configuration and repository pool object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
addURLParents(java.util.List targets, SVNURL url)
SVNCommitPacket
doCollectCommitItems(java.io.File[] paths, boolean keepLocks, boolean force, boolean recursive)
Deprecated.SVNCommitPacket[]
doCollectCommitItems(java.io.File[] paths, boolean keepLocks, boolean force, boolean recursive, boolean combinePackets)
Deprecated.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 differentSVNCommitPacket
s.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 singleSVNCommitPacket
.SVNCommitInfo
doCommit(java.io.File[] paths, boolean keepLocks, java.lang.String commitMessage, boolean force, boolean recursive)
Deprecated.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.SVNCommitInfo
doImport(java.io.File path, SVNURL dstURL, java.lang.String commitMessage, boolean useGlobalIgnores, boolean recursive)
Deprecated.SVNCommitInfo
doImport(java.io.File path, SVNURL dstURL, java.lang.String commitMessage, SVNProperties revisionProperties, boolean useGlobalIgnores, boolean ignoreUnknownNodeTypes, SVNDepth depth)
Imports file or directorypath
into repository directorydstURL
at HEAD revision.SVNCommitInfo
doImport(java.io.File path, SVNURL dstURL, java.lang.String commitMessage, SVNProperties revisionProperties, boolean useGlobalIgnores, boolean ignoreUnknownNodeTypes, SVNDepth depth, boolean applyAutoProperties)
Imports file or directorypath
into repository directorydstURL
at HEAD revision.SVNCommitInfo
doImport(java.io.File path, SVNURL dstURL, java.lang.String commitMessage, SVNProperties revisionProperties, boolean useGlobalIgnores, boolean ignoreUnknownNodeTypes, SVNDepth depth, boolean applyAutoProperties, ISVNFileFilter fileFilter)
Imports file or directorypath
into repository directorydstURL
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.private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>
getVersionedAutoProperties(SVNURL url, SVNURL reposRoot)
private static boolean
hasProcessedParents(java.util.Collection paths, java.lang.String path)
private boolean
importDir(SVNDeltaGenerator deltaGenerator, java.io.File dir, java.lang.String importPath, boolean useGlobalIgnores, boolean ignoreUnknownNodeTypes, SVNDepth depth, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> versionedAutoProperties, ISVNFileFilter fileFilter, ISVNEditor editor)
private boolean
importFile(SVNDeltaGenerator deltaGenerator, java.io.File file, SVNFileType fileType, java.lang.String filePath, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> versionedAutoProperties, ISVNEditor editor)
void
setCommitHander(ISVNCommitHandler handler)
Deprecated.usesetCommitHandler(ISVNCommitHandler)
insteadvoid
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.(package private) static java.lang.String
validateCommitMessage(java.lang.String message)
-
Methods inherited from class org.tmatesoft.svn.core.internal.wc16.SVNBasicDelegate
checkCancelled, createRepository, createRepository, createRepository, createWCAccess, createWCAccess, deriveLocation, dispatchEvent, dispatchEvent, elideMergeInfo, ensureSessionURL, getDebugLog, getEntryLocation, getEventDispatcher, getLevelsToLockFromDepth, getLocations, getOptions, getPathLastChangeRevision, getPathRelativeToRoot, getPathRelativeToSession, getRepositoryPool, getReposMergeInfo, getReposRoot, getRevisionNumber, getRevisionNumber, getURL, getWCMergeInfo, getWCOrRepositoryMergeInfo, handleEvent, handlePathListItem, isIgnoreExternals, isLeaveConflictsUnresolved, resolveRevisions, setCommitItemAccess, setCommitItemFlags, setCommitItemProperty, setDebugLog, setEventHandler, setEventPathPrefix, setIgnoreExternals, setLeaveConflictsUnresolved, setOptions, setPathListHandler, sleepForTimeStamp
-
-
-
-
Field Detail
-
myCommitHandler
private ISVNCommitHandler myCommitHandler
-
myCommitParameters
private ISVNCommitParameters myCommitParameters
-
-
Constructor Detail
-
SVNCommitClient16
public SVNCommitClient16(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
-
SVNCommitClient16
public SVNCommitClient16(ISVNRepositoryPool repositoryPool, ISVNOptions options)
Constructs and initializes an SVNCommitClient object with the specified run-time configuration and repository pool object. Ifoptions
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
). IfrepositoryPool
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.usesetCommitHandler(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 as SVNCommitItem 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 todoDelete(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'sevent 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 withSVNErrorCode.FS_NOT_FOUND
error code - if some ofurls
does not exist- 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 SVNException
Creates directory(ies) in a repository. IfmakeParents
is true, creates any non-existent parent directories also. 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'sevent handler
is not null and if the commit succeeds, the handler will be called withSVNEventAction.COMMIT_COMPLETED
event action.- Parameters:
urls
- repository locations to createcommitMessage
- commit log messagerevisionProperties
- custom revision propertiesmakeParents
- if true, creates all non-existent parent directories- 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 withSVNErrorCode.FS_NOT_FOUND
error code - if some ofurls
does not exist- Since:
- 1.2.0, SVN 1.5.0
-
doImport
public SVNCommitInfo doImport(java.io.File path, SVNURL dstURL, java.lang.String commitMessage, boolean recursive) throws SVNException
Deprecated.Committs an addition of a local unversioned file or directory into the repository. This method is identical todoImport(path, dstURL, commitMessage, null, true, false, SVNDepth.fromRecurse(recursive))
.- Parameters:
path
- a local unversioned file or directory to be imported into the repositorydstURL
- a URL-string that represents a repository location where thepath
will be importedcommitMessage
- a string to be a commit log messagerecursive
- this flag is relevant only when thepath
is a directory: if true then the entire directory tree will be imported including all child directories, otherwise only items located in the directory itself- Returns:
- information on a new revision as the result of the commit
- Throws:
SVNException
- if one of the following is true:dstURL
is invalid- the path denoted by
dstURL
already exists path
contains a reserved name - '.svn'
-
doImport
public SVNCommitInfo doImport(java.io.File path, SVNURL dstURL, java.lang.String commitMessage, boolean useGlobalIgnores, boolean recursive) throws SVNException
Deprecated.Committs an addition of a local unversioned file or directory into the repository. This method is identical todoImport(path, dstURL, commitMessage, null, useGlobalIgnores, false, SVNDepth.fromRecurse(recursive))
.- Parameters:
path
- a local unversioned file or directory to be imported into the repositorydstURL
- a URL-string that represents a repository location where thepath
will be importedcommitMessage
- a string to be a commit log messageuseGlobalIgnores
- if true then those paths that match global ignore patterns controlled by a config options driver (seeISVNOptions.getIgnorePatterns()
) will not be imported, otherwise global ignore patterns are not usedrecursive
- this flag is relevant only when thepath
is a directory: if true then the entire directory tree will be imported including all child directories, otherwise only items located in the directory itself- Returns:
- information on a new revision as the result of the commit
- Throws:
SVNException
- if one of the following is true:dstURL
is invalid- the path denoted by
dstURL
already exists path
contains a reserved name - '.svn'
-
doImport
public SVNCommitInfo doImport(java.io.File path, SVNURL dstURL, java.lang.String commitMessage, SVNProperties revisionProperties, boolean useGlobalIgnores, boolean ignoreUnknownNodeTypes, SVNDepth depth) throws SVNException
Imports file or directorypath
into repository directorydstURL
at HEAD revision. If some components ofdstURL
do not exist, then creates parent directories as necessary. Ifpath
is a directory, the contents of that directory are imported directly into the directory identified bydstURL
. Note that the directorypath
itself is not imported -- that is, the base name ofpath
is not part of the import. If
path
is a file, then the parent ofdstURL
is the directory receiving the import. The base name ofdstURL
is the filename in the repository. In this case ifdstURL
already exists, throwsSVNException
. If the caller'sevent handler
is not null it will be called as the import progresses withSVNEventAction.COMMIT_ADDED
action. If the commit succeeds, the handler will be called withSVNEventAction.COMMIT_COMPLETED
event action. 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. Ifdepth
isSVNDepth.EMPTY
, imports justpath
and nothing below it. IfSVNDepth.FILES
, importspath
and any file children ofpath
. IfSVNDepth.IMMEDIATES
, importspath
, any file children, and any immediate subdirectories (but nothing underneath those subdirectories). IfSVNDepth.INFINITY
, importspath
and everything under it fully recursively. IfuseGlobalIgnores
is false, doesn't add files or directories that match ignore patterns. IfignoreUnknownNodeTypes
is false, ignores files of which the node type is unknown, such as device files and pipes.- Parameters:
path
- path to importdstURL
- import destination urlcommitMessage
- commit log messagerevisionProperties
- custom revision propertiesuseGlobalIgnores
- whether matching against global ignore patterns should take placeignoreUnknownNodeTypes
- whether to ignore files of unknown node types or notdepth
- tree depth to process- Returns:
- information about the new committed revision
- Throws:
SVNException
- in the following cases:-
exception with
SVNErrorCode.ENTRY_NOT_FOUND
error code - ifpath
does not exist exception withSVNErrorCode.ENTRY_EXISTS
error code - ifdstURL
already exists andpath
is a file exception withSVNErrorCode.CL_ADM_DIR_RESERVED
error code - if trying to import an item with a reserved SVN name (like'.svn'
or'_svn'
)- Since:
- 1.2.0, New in SVN 1.5.0
-
doImport
public SVNCommitInfo doImport(java.io.File path, SVNURL dstURL, java.lang.String commitMessage, SVNProperties revisionProperties, boolean useGlobalIgnores, boolean ignoreUnknownNodeTypes, SVNDepth depth, boolean applyAutoProperties) throws SVNException
Imports file or directorypath
into repository directorydstURL
at HEAD revision. If some components ofdstURL
do not exist, then creates parent directories as necessary. Ifpath
is a directory, the contents of that directory are imported directly into the directory identified bydstURL
. Note that the directorypath
itself is not imported -- that is, the base name ofpath
is not part of the import. If
path
is a file, then the parent ofdstURL
is the directory receiving the import. The base name ofdstURL
is the filename in the repository. In this case ifdstURL
already exists, throwsSVNException
. If the caller'sevent handler
is not null it will be called as the import progresses withSVNEventAction.COMMIT_ADDED
action. If the commit succeeds, the handler will be called withSVNEventAction.COMMIT_COMPLETED
event action. 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. Ifdepth
isSVNDepth.EMPTY
, imports justpath
and nothing below it. IfSVNDepth.FILES
, importspath
and any file children ofpath
. IfSVNDepth.IMMEDIATES
, importspath
, any file children, and any immediate subdirectories (but nothing underneath those subdirectories). IfSVNDepth.INFINITY
, importspath
and everything under it fully recursively. IfuseGlobalIgnores
is false, doesn't add files or directories that match ignore patterns. IfignoreUnknownNodeTypes
is false, ignores files of which the node type is unknown, such as device files and pipes.- Parameters:
path
- path to importdstURL
- import destination urlcommitMessage
- commit log messagerevisionProperties
- custom revision propertiesuseGlobalIgnores
- whether matching against global ignore patterns should take placeignoreUnknownNodeTypes
- whether to ignore files of unknown node types or notdepth
- tree depth to processapplyAutoProperties
- disable or not auto-properties application- Returns:
- information about the new committed revision
- Throws:
SVNException
- in the following cases:-
exception with
SVNErrorCode.ENTRY_NOT_FOUND
error code - ifpath
does not exist exception withSVNErrorCode.ENTRY_EXISTS
error code - ifdstURL
already exists andpath
is a file exception withSVNErrorCode.CL_ADM_DIR_RESERVED
error code - if trying to import an item with a reserved SVN name (like'.svn'
or'_svn'
)- Since:
- SVN 1.8
-
doImport
public SVNCommitInfo doImport(java.io.File path, SVNURL dstURL, java.lang.String commitMessage, SVNProperties revisionProperties, boolean useGlobalIgnores, boolean ignoreUnknownNodeTypes, SVNDepth depth, boolean applyAutoProperties, ISVNFileFilter fileFilter) throws SVNException
Imports file or directorypath
into repository directorydstURL
at HEAD revision. If some components ofdstURL
do not exist, then creates parent directories as necessary. Ifpath
is a directory, the contents of that directory are imported directly into the directory identified bydstURL
. Note that the directorypath
itself is not imported -- that is, the base name ofpath
is not part of the import. If
path
is a file, then the parent ofdstURL
is the directory receiving the import. The base name ofdstURL
is the filename in the repository. In this case ifdstURL
already exists, throwsSVNException
. If the caller'sevent handler
is not null it will be called as the import progresses withSVNEventAction.COMMIT_ADDED
action. If the commit succeeds, the handler will be called withSVNEventAction.COMMIT_COMPLETED
event action. 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. Ifdepth
isSVNDepth.EMPTY
, imports justpath
and nothing below it. IfSVNDepth.FILES
, importspath
and any file children ofpath
. IfSVNDepth.IMMEDIATES
, importspath
, any file children, and any immediate subdirectories (but nothing underneath those subdirectories). IfSVNDepth.INFINITY
, importspath
and everything under it fully recursively. IfuseGlobalIgnores
is false, doesn't add files or directories that match ignore patterns. IfignoreUnknownNodeTypes
is false, ignores files of which the node type is unknown, such as device files and pipes.- Parameters:
path
- path to importdstURL
- import destination urlcommitMessage
- commit log messagerevisionProperties
- custom revision propertiesuseGlobalIgnores
- whether matching against global ignore patterns should take placeignoreUnknownNodeTypes
- whether to ignore files of unknown node types or notdepth
- tree depth to processapplyAutoProperties
- disable or not auto-properties applicationfileFilter
- filter to exclude or include certain files for the operation- Returns:
- information about the new committed revision
- Throws:
SVNException
- in the following cases:-
exception with
SVNErrorCode.ENTRY_NOT_FOUND
error code - ifpath
does not exist exception withSVNErrorCode.ENTRY_EXISTS
error code - ifdstURL
already exists andpath
is a file exception withSVNErrorCode.CL_ADM_DIR_RESERVED
error code - if trying to import an item with a reserved SVN name (like'.svn'
or'_svn'
)- Since:
- SVN 1.8
-
doCommit
public SVNCommitInfo doCommit(java.io.File[] paths, boolean keepLocks, java.lang.String commitMessage, boolean force, boolean recursive) throws SVNException
Deprecated.Committs local changes to the repository. This method is identical todoCommit(paths, keepLocks, commitMessage, null, null, false, force, SVNDepth.fromRecurse(recursive))
.- Parameters:
paths
- an array of local items which should be traversed to commit changes they have to the repositorykeepLocks
- if true and there are local items that were locked then the commit will left them locked, otherwise the items will be unlocked after the commit succeedscommitMessage
- a string to be a commit log messageforce
- true to force a non-recursive commit; ifrecursive
is set to true theforce
flag is ignoredrecursive
- relevant only for directory items: if true then the entire directory tree will be committed including all child directories, otherwise only items located in the directory itself- Returns:
- information on a new revision as the result of the commit
- Throws:
SVNException
-
doCommit
public SVNCommitInfo doCommit(java.io.File[] paths, boolean keepLocks, java.lang.String commitMessage, SVNProperties revisionProperties, java.lang.String[] changelists, boolean keepChangelist, boolean force, SVNDepth depth) throws SVNException
Commits files or directories into repository.paths
need not be canonicalized nor condensed; this method will take care of that. Iftargets has zero elements, then do nothing and return immediately without error. 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. If the caller'sevent handler
is not null it will be called as the commit progresses with any of the following actions:SVNEventAction.COMMIT_MODIFIED
,SVNEventAction.COMMIT_ADDED
,SVNEventAction.COMMIT_DELETED
,SVNEventAction.COMMIT_REPLACED
. If the commit succeeds, the handler will be called withSVNEventAction.COMMIT_COMPLETED
event action. Ifdepth
isSVNDepth.INFINITY
, commits all changes to and below named targets. Ifdepth
isSVNDepth.EMPTY
, commits only named targets (that is, only property changes on named directory targets, and property and content changes for named file targets). Ifdepth
isSVNDepth.FILES
, behaves as above for named file targets, and for named directory targets, commits property changes on a named directory and all changes to files directly inside that directory. IfSVNDepth.IMMEDIATES
, behaves as forSVNDepth.FILES
, and for subdirectories of any named directory target commits as though forSVNDepth.EMPTY
. Unlocks paths in the repository, unlesskeepLocks
is true.changelists
is an array ofString
changelist names, used as a restrictive filter on items that are committed; that is, doesn't commit anything unless it's a member of one of those changelists. After the commit completes successfully, removes changelist associations from the targets, unlesskeepChangelist
is set. Ifchangelists
is empty (or altogether null), no changelist filtering occurs. If no exception is thrown andSVNCommitInfo.getNewRevision()
is invalid (<0
), then the commit was a no-op; nothing needed to be committed.- Parameters:
paths
- paths to commitkeepLocks
- whether to unlock or not files in the repositorycommitMessage
- commit log messagerevisionProperties
- custom revision propertieschangelists
- changelist names arraykeepChangelist
- whether to removechangelists
or notforce
- true to force a non-recursive commit; ifdepth
isSVNDepth.INFINITY
theforce
flag is ignoreddepth
- tree depth to process- Returns:
- information about the new committed revision
- Throws:
SVNException
- Since:
- 1.2.0, New in Subversion 1.5.0
-
doCommit
public SVNCommitInfo doCommit(SVNCommitPacket commitPacket, boolean keepLocks, java.lang.String commitMessage) throws SVNException
Committs local changes made to the Working Copy items to the repository.This method is identical to
doCommit(commitPacket, keepLocks, false, commitMessage, null)
.commitPacket
contains commit items (SVNCommitItem
) which represent local Working Copy items that were changed and are to be committed. Commit items are gathered into a singleSVNCommitPacket
by invokingdoCollectCommitItems()
.- Parameters:
commitPacket
- a single object that contains items to be committedkeepLocks
- if true and there are local items that were locked then the commit will left them locked, otherwise the items will be unlocked after the commit succeedscommitMessage
- a string to be a commit log message- Returns:
- information on a new revision as the result of the commit
- Throws:
SVNException
- See Also:
SVNCommitItem
-
doCommit
public SVNCommitInfo doCommit(SVNCommitPacket commitPacket, boolean keepLocks, boolean keepChangelist, java.lang.String commitMessage, SVNProperties revisionProperties) throws SVNException
Commits files or directories into repository. This method is identical todoCommit(File[],boolean,String,SVNProperties,String[],boolean,boolean,SVNDepth)
except for it receives a commit packet instead of paths array. The aforementioned method collects commit items into a commit packet given working copy paths. This one accepts already collected commit items provided incommitPacket
.commitPacket
contains commit items (SVNCommitItem
) which represent local Working Copy items that are to be committed. Commit items are gathered in a singleSVNCommitPacket
by invoking eitherdoCollectCommitItems(File[],boolean,boolean,SVNDepth,String[])
ordoCollectCommitItems(File[],boolean,boolean,SVNDepth,boolean,String[])
. For more details on parameters, please, refer todoCommit(File[],boolean,String,SVNProperties,String[],boolean,boolean,SVNDepth)
.- Parameters:
commitPacket
- a single object that contains items to be committedkeepLocks
- if true and there are local items that were locked then the commit will left them locked, otherwise the items will be unlocked after the commit succeedskeepChangelist
- whether to remove changelists or notcommitMessage
- commit log messagerevisionProperties
- custom revision properties- Returns:
- information about the new committed revision
- Throws:
SVNException
- Since:
- 1.2.0, SVN 1.5.0
-
doCommit
public SVNCommitInfo[] doCommit(SVNCommitPacket[] commitPackets, boolean keepLocks, java.lang.String commitMessage) throws SVNException
Committs local changes, made to the Working Copy items, to the repository.commitPackets
is an array of packets that contain commit items (SVNCommitItem) which represent local Working Copy items that were changed and are to be committed. Commit items are gathered in a single SVNCommitPacket by invokingdoCollectCommitItems()
.This allows to commit separate trees of Working Copies "belonging" to different repositories. One packet per one repository. If repositories are different (it means more than one commit will be done),
commitMessage
may be replaced by a commit handler to be a specific one for each commit.This method is identical to
doCommit(commitPackets, keepLocks, false, commitMessage, null)
.- Parameters:
commitPackets
- logically grouped items to be committedkeepLocks
- if true and there are local items that were locked then the commit will left them locked, otherwise the items will be unlocked after the commit succeedscommitMessage
- a string to be a commit log message- Returns:
- committed information
- Throws:
SVNException
-
doCommit
public SVNCommitInfo[] doCommit(SVNCommitPacket[] commitPackets, boolean keepLocks, boolean keepChangelist, java.lang.String commitMessage, SVNProperties revisionProperties) throws SVNException
Commits files or directories into repository.commitPackets
is an array of packets that contain commit items (SVNCommitItem
) which represent local Working Copy items that were changed and are to be committed. Commit items are gathered in a singleSVNCommitPacket
by invokingdoCollectCommitItems(File[],boolean,boolean,SVNDepth,String[])
ordoCollectCommitItems(File[],boolean,boolean,SVNDepth,boolean,String[])
.This allows to commit items from separate Working Copies checked out from the same or different repositories. For each commit packet
For more details on parameters, please, refer tocommit handler
is invoked to produce a commit message given the onecommitMessage
passed to this method. Each commit packet is committed in a separate transaction.doCommit(File[],boolean,String,SVNProperties,String[],boolean,boolean,SVNDepth)
.- Parameters:
commitPackets
- commit packets containing commit commit items per one commitkeepLocks
- if true and there are local items that were locked then the commit will left them locked, otherwise the items will be unlocked by the commitkeepChangelist
- whether to remove changelists or notcommitMessage
- a string to be a commit log messagerevisionProperties
- custom revision properties- Returns:
- information about the new committed revisions
- Throws:
SVNException
- Since:
- 1.2.0, SVN 1.5.0
-
doCollectCommitItems
public SVNCommitPacket doCollectCommitItems(java.io.File[] paths, boolean keepLocks, boolean force, boolean recursive) throws SVNException
Deprecated.Collects commit items (containing detailed information on each Working Copy item that was changed and need to be committed to the repository) into a singleSVNCommitPacket
. This method is equivalent todoCollectCommitItems(paths, keepLocks, force, SVNDepth.fromRecurse(recursive), null)
.- Parameters:
paths
- an array of local items which should be traversed to collect information on every changed item (one SVNCommitItem per each modified local item)keepLocks
- if true and there are local items that were locked then these items will be left locked after traversing all of them, otherwise the items will be unlockedforce
- forces collecting commit items for a non-recursive commitrecursive
- relevant only for directory items: if true then the entire directory tree will be traversed including all child directories, otherwise only items located in the directory itself will be processed- Returns:
- an SVNCommitPacket containing all Working Copy items
having local modifications and represented as
SVNCommitItem objects; if no modified items were found
then
SVNCommitPacket.EMPTY
is returned - Throws:
SVNException
-
doCollectCommitItems
public SVNCommitPacket doCollectCommitItems(java.io.File[] paths, boolean keepLocks, boolean force, SVNDepth depth, java.lang.String[] changelists) throws SVNException
Collects commit items (containing detailed information on each Working Copy item that contains changes and need to be committed to the repository) into a singleSVNCommitPacket
. Further this commit packet can be passed todoCommit(SVNCommitPacket,boolean,boolean,String,SVNProperties)
. For more details on parameters, please, refer todoCommit(File[],boolean,String,SVNProperties,String[],boolean,boolean,SVNDepth)
.- Parameters:
paths
- an array of local items which should be traversed to collect information on every changed item (one SVNCommitItem per each modified local item)keepLocks
- if true and there are local items that were locked then these items will be left locked after traversing all of them, otherwise the items will be unlockedforce
- forces collecting commit items for a non-recursive commitdepth
- tree depth to processchangelists
- changelist names array- Returns:
- commit packet containing commit items
- Throws:
SVNException
- Since:
- 1.2.0
-
doCollectCommitItems
public SVNCommitPacket[] doCollectCommitItems(java.io.File[] paths, boolean keepLocks, boolean force, boolean recursive, boolean combinePackets) throws SVNException
Deprecated.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. This method is identical todoCollectCommitItems(paths, keepLocks, force, SVNDepth.fromRecurse(recursive), combinePackets, null)
.- Parameters:
paths
- an array of local items which should be traversed to collect information on every changed item (one SVNCommitItem per each modified local item)keepLocks
- if true and there are local items that were locked then these items will be left locked after traversing all of them, otherwise the items will be unlockedforce
- forces collecting commit items for a non-recursive commitrecursive
- relevant only for directory items: if true then the entire directory tree will be traversed including all child directories, otherwise only items located in the directory itself will be processedcombinePackets
- if true then collected commit packets will be joined into a single one, so that to be committed in a single transaction- Returns:
- an array of commit packets
- Throws:
SVNException
-
doCollectCommitItems
public SVNCommitPacket[] doCollectCommitItems(java.io.File[] paths, boolean keepLocks, boolean force, SVNDepth depth, boolean combinePackets, java.lang.String[] changelists) throws SVNException
Collects commit items (containing detailed information on each Working Copy item that was changed and need to be committed to the repository) into differentSVNCommitPacket
s. This method may be considered as an advanced version of thedoCollectCommitItems(File[],boolean,boolean,SVNDepth,String[])
method. Its main difference from the aforementioned method is that it provides an ability to collect commit items from different working copies checked out from the same repository and combine them into a single commit packet. This is attained via settingcombinePackets
into true. However even ifcombinePackets
is set, combining may only occur if (besides that the paths must be from the same repository) URLs ofpaths
are formed of identical components, that is protocol name, host name, port number (if any) must match for all paths. Otherwise combining will not occur. Combined items will be committed in a single transaction. For details on other parameters, please, refer todoCommit(File[],boolean,String,SVNProperties,String[],boolean,boolean,SVNDepth)
.- Parameters:
paths
- an array of local items which should be traversed to collect information on every changed item (one SVNCommitItem per each modified local item)keepLocks
- if true and there are local items that were locked then these items will be left locked after traversing all of them, otherwise the items will be unlockedforce
- forces collecting commit items for a non-recursive commitdepth
- tree depth to processcombinePackets
- whether combining commit packets into a single commit packet is allowed or notchangelists
- changelist names array- Returns:
- array of commit packets
- Throws:
SVNException
- in the following cases:-
exception with
SVNErrorCode.ENTRY_MISSING_URL
error code - if working copy root of either path has no url- Since:
- 1.2.0
-
addURLParents
private void addURLParents(java.util.List targets, SVNURL url) throws SVNException
- Throws:
SVNException
-
importDir
private boolean importDir(SVNDeltaGenerator deltaGenerator, java.io.File dir, java.lang.String importPath, boolean useGlobalIgnores, boolean ignoreUnknownNodeTypes, SVNDepth depth, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> versionedAutoProperties, ISVNFileFilter fileFilter, ISVNEditor editor) throws SVNException
- Throws:
SVNException
-
importFile
private boolean importFile(SVNDeltaGenerator deltaGenerator, java.io.File file, SVNFileType fileType, java.lang.String filePath, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> versionedAutoProperties, ISVNEditor editor) throws SVNException
- Throws:
SVNException
-
hasProcessedParents
private static boolean hasProcessedParents(java.util.Collection paths, java.lang.String path) throws SVNException
- Throws:
SVNException
-
validateCommitMessage
static java.lang.String validateCommitMessage(java.lang.String message)
-
getVersionedAutoProperties
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getVersionedAutoProperties(SVNURL url, SVNURL reposRoot) throws SVNException
- Throws:
SVNException
-
-