java.lang.Object org.tmatesoft.svn.core.wc.SVNBasicClient org.tmatesoft.svn.core.wc.SVNUpdateClient
-
public class SVNUpdateClient
- extends SVNBasicClient
This class provides methods which allow to check out, update, switch and relocate a Working Copy as well as export an unversioned directory or file from a repository.
Here's a list of the SVNUpdateClient's methods matched against corresponing commands of the SVN command line client:
SVNKit | Subversion |
doCheckout() | 'svn checkout' |
doUpdate() | 'svn update' |
doSwitch() | 'svn switch' |
doRelocate() | 'svn switch --relocate oldURL newURL' |
doExport() | 'svn export' |
- Since:
- 1.2
- See Also:
- Examples
Constructor Summary | |
---|---|
SVNUpdateClient(ISVNAuthenticationManager authManager, ISVNOptions options) Constructs and initializes an SVNUpdateClient object with the specified run-time configuration and authentication drivers. |
|
SVNUpdateClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) Constructs and initializes an SVNUpdateClient object with the specified run-time configuration and authentication drivers. |
Method Summary | |
---|---|
void |
doCanonicalizeURLs(java.io.File dst, Canonicalizes all urls in the specified Working Copy. |
long |
doCheckout(SVNURL url, Deprecated. use doCheckout(SVNURL, instead |
long |
doCheckout(SVNURL url, Deprecated. use doCheckout(SVNURL, instead |
long |
doCheckout(SVNURL url, Checks out a working copy of url at revision , looked up at pegRevision , using dstPath as the root directory of the newly checked out working copy. |
long |
doExport(java.io.File srcPath, Deprecated. use doExport(File, |
long |
doExport(java.io.File srcPath, Exports the contents of either a subversion repository or a subversion working copy into a 'clean' directory (meaning a directory with no administrative directories). |
long |
doExport(SVNURL url, Deprecated. use doExport(SVNURL, |
long |
doExport(SVNURL url, Exports the contents of a subversion repository into a 'clean' directory (meaning a directory with no administrative directories). |
void |
doRelocate(java.io.File dst, SVNURL oldURL, SVNURL newURL, Substitutes the beginning part of a Working Copy's URL with a new one. |
long |
doSwitch(java.io.File file, SVNURL url, SVNRevision revision, Deprecated. use doSwitch(File, instead |
long |
doSwitch(java.io.File file, SVNURL url, SVNRevision pegRevision, SVNRevision revision, Deprecated. use doSwitch(File, instead |
long |
doSwitch(java.io.File file, SVNURL url, SVNRevision pegRevision, SVNRevision revision, Deprecated. use doSwitch(File, instead |
long |
doSwitch(java.io.File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, Switches working tree path to url \ pegRevision at revision . |
long |
doSwitch(java.io.File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, |
long[] |
doUpdate(java.io.File[] paths, SVNRevision revision, SVNDepth depth, Updates working trees paths to revision . |
long[] |
doUpdate(java.io.File[] paths, SVNRevision revision, SVNDepth depth, |
long |
doUpdate(java.io.File file, SVNRevision revision, Deprecated. use doUpdate(File, instead |
long |
doUpdate(java.io.File file, SVNRevision revision, Deprecated. use doUpdate(File, instead |
long |
doUpdate(java.io.File path, SVNRevision revision, SVNDepth depth, Updates working copy to revision . |
ISVNExternalsHandler |
getExternalsHandler() Returns an externals handler used by this update client. |
boolean |
isExportExpandsKeywords() Says whether keywords expansion during export operations is turned on or not. |
boolean |
isUpdateLocksOnDemand() Says whether the entire working copy should be locked while updating or not. |
void |
setExportExpandsKeywords(boolean expand) Sets whether keywords must be expanded during an export operation. |
void |
setExternalsHandler(ISVNExternalsHandler externalsHandler) Sets an externals handler to be used by this client object. |
void |
setUpdateLocksOnDemand(boolean locksOnDemand) Sets whether working copies should be locked on demand or not during an update process. |
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 |
---|
SVNUpdateClient
public SVNUpdateClient(ISVNAuthenticationManager authManager, ISVNOptions options)
- Constructs and initializes an SVNUpdateClient object with the specified run-time configuration and authentication drivers.
If
options
is null, then this SVNUpdateClient 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 SVNUpdateClient 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
SVNUpdateClient
public SVNUpdateClient(ISVNRepositoryPool repositoryPool, ISVNOptions options)
- Constructs and initializes an SVNUpdateClient object with the specified run-time configuration and authentication drivers.
If
options
is null, then this SVNUpdateClient 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 |
---|
setExternalsHandler
public void setExternalsHandler(ISVNExternalsHandler externalsHandler)
- Sets an externals handler to be used by this client object.
-
- Parameters:
externalsHandler
- user's implementation ofISVNExternalsHandler
- Since:
- 1.2
- See Also:
getExternalsHandler()
getExternalsHandler
public ISVNExternalsHandler getExternalsHandler()
- Returns an externals handler used by this update client.
If no user's handler is provided then
ISVNExternalsHandler.DEFAULT
is returned
and used by this client object by default.For more information what externals handlers are for, please, refer to
ISVNExternalsHandler
. -
- Returns:
- externals handler being in use
- Since:
- 1.2
- See Also:
setExternalsHandler(ISVNExternalsHandler)
doUpdate
public long doUpdate(java.io.File file, SVNRevision revision, boolean recursive) throws SVNException
- Deprecated. use
doUpdate(File,
instead
SVNRevision, SVNDepth, boolean, boolean) - Brings the Working Copy item up-to-date with repository changes at the specified revision.
As a revision SVNRevision's pre-defined constant fields can be used. For example, to update the Working Copy to the latest revision of the repository use
HEAD
. -
- Parameters:
file
- the Working copy item to be updatedrevision
- the desired revision against which the item will be updatedrecursive
- if true andfile
is a directory then the entire tree will be updated, otherwise if false -
only items located immediately in the directory itself- Returns:
- the revision number to which
file
was updated to - Throws:
SVNException
doUpdate
public long doUpdate(java.io.File file, SVNRevision revision, boolean recursive, boolean force) throws SVNException
- Deprecated. use
doUpdate(File,
instead
SVNRevision, SVNDepth, boolean, boolean) -
- Parameters:
file
-revision
-recursive
-force
-- Returns:
- actual revision number
- Throws:
SVNException
doUpdate
public long[] doUpdate(java.io.File[] paths, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky) throws SVNException
- Updates working trees
paths
torevision
. Unversioned paths that are direct children of a versioned path will cause an update that attempts to add that path, other unversioned paths are skipped.revision
must represent a valid revision number (SVNRevision.getNumber()
>=
0), or date (SVNRevision.getDate()
!= true),
or be equal toSVNRevision.HEAD
. Ifrevision
does not meet these requirements,
an exception with the error codeSVNErrorCode.CLIENT_BAD_REVISION
is thrown.The paths in
paths
can be from multiple working copies from multiple repositories, but even if they all come from the same repository there is no guarantee that revision represented bySVNRevision.HEAD
will
remain the same as each path is updated.If externals are
ignored
, doesn't process externals definitions as part
of this operation.If
depth
isSVNDepth.INFINITY
, updates fully recursively. Else if it isSVNDepth.IMMEDIATES
orSVNDepth.FILES
,
updates each target and its file entries, but not its subdirectories. Else ifSVNDepth.EMPTY
,
updates exactly each target, nonrecursively (essentially, updates the target's properties).If
depth
isSVNDepth.UNKNOWN
, takes the working depth frompaths
and
then behaves as described above.If
depthIsSticky
is set anddepth
is notSVNDepth.UNKNOWN
, then
in addition to updatingpaths
, also sets their sticky ambient depth value todepth
.If
allowUnversionedObstructions
is true then the update tolerates existing unversioned items that obstruct added paths.
Only obstructions of the same type (file or dir) as the added item are tolerated. The text of obstructing files is left as-is, effectively treating it as a user modification after the update. Working properties of obstructing items are set equal to the base
properties. IfallowUnversionedObstructions
is false then the update will abort if there are any unversioned obstructing
items.If the caller's
ISVNEventHan