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

Class SVNUpdateClient

2013年08月03日 ⁄ 综合 ⁄ 共 11118字 ⁄ 字号 评论关闭

java.lang.Object
  extended by org.tmatesoft.svn.core.wc.SVNBasicClient
      extended by 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,
boolean omitDefaultPort, boolean recursive)
 
          Canonicalizes all urls in the specified Working Copy.
 long doCheckout(SVNURL url,
java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision,
boolean recursive)
 
          Deprecated. use doCheckout(SVNURL,
File, SVNRevision, SVNRevision, SVNDepth, boolean)
 instead
 long doCheckout(SVNURL url,
java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision,
boolean recursive, boolean force)
 
          Deprecated. use doCheckout(SVNURL,
File, SVNRevision, SVNRevision, SVNDepth, boolean)
 instead
 long doCheckout(SVNURL url,
java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth,
boolean allowUnversionedObstructions)
 
          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,
java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision,
java.lang.String eolStyle, boolean force, boolean recursive)
 
          Deprecated. use doExport(File,
File, SVNRevision, SVNRevision, String, boolean, SVNDepth)
 long doExport(java.io.File srcPath,
java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision,
java.lang.String eolStyle, boolean overwrite, SVNDepth depth)
 
          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,
java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision,
java.lang.String eolStyle, boolean force, boolean recursive)
 
          Deprecated. use doExport(SVNURL,
File, SVNRevision, SVNRevision, String, boolean, SVNDepth)
 long doExport(SVNURL url,
java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision,
java.lang.String eolStyle, boolean overwrite, SVNDepth depth)
 
          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,
boolean recursive)
 
          Substitutes the beginning part of a Working Copy's URL with a new one.
 long doSwitch(java.io.File file, SVNURL url, SVNRevision revision,
boolean recursive)
 
          Deprecated. use doSwitch(File,
SVNURL, SVNRevision, SVNRevision, SVNDepth, boolean, boolean)
 instead
 long doSwitch(java.io.File file, SVNURL url, SVNRevision pegRevision, SVNRevision revision,
boolean recursive)
 
          Deprecated. use doSwitch(File,
SVNURL, SVNRevision, SVNRevision, SVNDepth, boolean, boolean)
 instead
 long doSwitch(java.io.File file, SVNURL url, SVNRevision pegRevision, SVNRevision revision,
boolean recursive, boolean force)
 
          Deprecated. use doSwitch(File,
SVNURL, SVNRevision, SVNRevision, SVNDepth, boolean, boolean)
 instead
 long doSwitch(java.io.File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth,
boolean allowUnversionedObstructions, boolean depthIsSticky)
 
          Switches working tree path to urlpegRevision at revision.
 long doSwitch(java.io.File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth,
boolean allowUnversionedObstructions, boolean depthIsSticky, boolean ignoreAncestry)
 
           
 long[] doUpdate(java.io.File[] paths, SVNRevision revision, SVNDepth depth,
boolean allowUnversionedObstructions, boolean depthIsSticky)
 
          Updates working trees paths to revision.
 long[] doUpdate(java.io.File[] paths, SVNRevision revision, SVNDepth depth,
boolean allowUnversionedObstructions, boolean depthIsSticky, boolean makeParents)
 
           
 long doUpdate(java.io.File file, SVNRevision revision,
boolean recursive)
 
          Deprecated. use doUpdate(File,
SVNRevision, SVNDepth, boolean, boolean)
 instead
 long doUpdate(java.io.File file, SVNRevision revision,
boolean recursive, boolean force)
 
          Deprecated. use doUpdate(File,
SVNRevision, SVNDepth, boolean, boolean)
 instead
 long doUpdate(java.io.File path, SVNRevision revision, SVNDepth depth,
boolean allowUnversionedObstructions, boolean depthIsSticky)
 
          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
dontWC17SupportgetDebugLoggetOperationsFactorygetOptionsgetPathListHandlergetReposRootgetReposRootisIgnoreExternalsisLeaveConflictsUnresolvedisWC17SupportedsetDebugLog,setEventHandlersetEventPathPrefixsetIgnoreExternalssetLeaveConflictsUnresolvedsetOptionssetPathListHandler

 

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

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

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

setExternalsHandler

public void setExternalsHandler(ISVNExternalsHandler externalsHandler)
Sets an externals handler to be used by this client object.

Parameters:
externalsHandler - user's implementation of ISVNExternalsHandler
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,
SVNRevision, SVNDepth, boolean, boolean)
 instead

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 updated
revision - the desired revision against which the item will be updated
recursive - if true and file 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,
SVNRevision, SVNDepth, boolean, boolean)
 instead

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 to revision. 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 to SVNRevision.HEAD. If revision does not meet these requirements,
an exception with the error code SVNErrorCode.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 by SVNRevision.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 is SVNDepth.INFINITY, updates fully recursively. Else if it is SVNDepth.IMMEDIATES or SVNDepth.FILES,
updates each target and its file entries, but not its subdirectories. Else if SVNDepth.EMPTY,
updates exactly each target, nonrecursively (essentially, updates the target's properties).

If depth is SVNDepth.UNKNOWN, takes the working depth from paths and
then behaves as described above.

If depthIsSticky is set and depth is not SVNDepth.UNKNOWN, then
in addition to updating paths , also sets their sticky ambient depth value to depth.

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. If allowUnversionedObstructions is false then the update will abort if there are any unversioned obstructing
items.

If the caller's ISVNEventHan

抱歉!评论已关闭.