Class SVNUpdateClient16
- java.lang.Object
-
- org.tmatesoft.svn.core.internal.wc16.SVNBasicDelegate
-
- org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16
-
- All Implemented Interfaces:
ISVNCanceller
,ISVNEventHandler
public class SVNUpdateClient16 extends SVNBasicDelegate
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
- Version:
- 1.3
- See Also:
- Examples
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
SVNUpdateClient16.ExternalDiff
-
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 ISVNExternalsHandler
myExternalsHandler
private boolean
myIsExportExpandsKeywords
private boolean
myIsUpdateLocksOnDemand
-
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 SVNUpdateClient16(ISVNAuthenticationManager authManager, ISVNOptions options)
Constructs and initializes an SVNUpdateClient object with the specified run-time configuration and authentication drivers.SVNUpdateClient16(ISVNRepositoryPool repositoryPool, ISVNOptions options)
Constructs and initializes an SVNUpdateClient object with the specified run-time configuration and authentication drivers.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private static boolean
canonicalizeEntry(SVNEntry entry, boolean omitDefaultPort)
static java.lang.String
canonicalizeExtenrals(java.lang.String externals, boolean omitDefaultPort)
static SVNURL
canonicalizeURL(SVNURL url, boolean omitDefaultPort)
private void
copyVersionedDir(java.io.File from, java.io.File to, SVNRevision revision, java.lang.String eolStyle, boolean force, SVNDepth depth)
private void
copyVersionedFile(java.io.File dstPath, SVNAdminArea adminArea, java.lang.String fileName, SVNRevision revision, java.lang.String eol)
private void
deleteExternal(java.io.File external)
void
doCanonicalizeURLs(java.io.File dst, boolean omitDefaultPort, boolean recursive)
Canonicalizes all urls in the specified Working Copy.private void
doCanonicalizeURLs(SVNAdminAreaInfo adminAreaInfo, SVNAdminArea adminArea, java.lang.String name, boolean omitDefaultPort, boolean recursive)
long
doCheckout(SVNURL url, java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision, boolean recursive)
Deprecated.long
doCheckout(SVNURL url, java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision, boolean recursive, boolean force)
Deprecated.long
doCheckout(SVNURL url, java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions)
Checks out a working copy ofurl
atrevision
, looked up atpegRevision
, usingdstPath
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)
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)
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.private java.util.Map
doRelocate(SVNAdminArea adminArea, java.lang.String name, java.lang.String from, java.lang.String to, boolean recursive, java.util.Map validatedURLs)
private long
doRemoteExport(SVNRepository repository, long revNumber, java.io.File dstPath, java.lang.String eolStyle, boolean force, SVNDepth depth)
long
doSwitch(java.io.File file, SVNURL url, SVNRevision revision, boolean recursive)
Deprecated.long
doSwitch(java.io.File file, SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive)
Deprecated.long
doSwitch(java.io.File file, SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive, boolean force)
Deprecated.long
doSwitch(java.io.File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky)
Switches working treepath
tourl
\pegRevision
atrevision
.private long
doSwitchImpl(SVNWCAccess wcAccess, java.io.File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky)
long[]
doUpdate(java.io.File[] paths, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky)
Updates working treespaths
torevision
.long
doUpdate(java.io.File file, SVNRevision revision, boolean recursive)
Deprecated.long
doUpdate(java.io.File file, SVNRevision revision, boolean recursive, boolean force)
Deprecated.long
doUpdate(java.io.File path, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky)
Updates working copyto
revision
.ISVNExternalsHandler
getExternalsHandler()
Returns an externals handler used by this update client.private SVNURL
getOwnerURL(java.io.File root)
private void
handleExternalChange(SVNWCAccess access, java.lang.String targetDir, SVNUpdateClient16.ExternalDiff externalDiff)
oldURL is null when externals is added: jsvn ps svn:externals "path URL" .private void
handleExternalItemChange(SVNWCAccess access, java.lang.String targetDir, SVNUpdateClient16.ExternalDiff externalDiff)
private void
handleExternals(SVNWCAccess wcAccess, java.io.File root, java.util.Map oldExternals, java.util.Map newExternals, java.util.Map depths, SVNURL fromURL, SVNURL rootURL, SVNDepth requestedDepth, boolean isExport, boolean updateUnchanged)
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.private java.util.Map
relocateEntry(SVNEntry entry, java.lang.String from, java.lang.String to, java.util.Map validatedURLs)
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.private void
switchFileExternal(SVNWCAccess wcAccess, java.io.File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNURL reposRootURL)
private long
update(java.io.File path, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky, boolean sendCopyFrom)
private java.util.Map
validateRelocateTargetURL(SVNURL targetURL, java.lang.String expectedUUID, java.util.Map validatedURLs, boolean isRoot)
-
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
-
myExternalsHandler
private ISVNExternalsHandler myExternalsHandler
-
myIsUpdateLocksOnDemand
private boolean myIsUpdateLocksOnDemand
-
myIsExportExpandsKeywords
private boolean myIsExportExpandsKeywords
-
-
Constructor Detail
-
SVNUpdateClient16
public SVNUpdateClient16(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
-
SVNUpdateClient16
public SVNUpdateClient16(ISVNRepositoryPool repositoryPool, ISVNOptions options)
Constructs and initializes an SVNUpdateClient object with the specified run-time configuration and authentication drivers. Ifoptions
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
). 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
-
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 thenISVNExternalsHandler.DEFAULT
is returned and used by this client object by default. For more information what externals handlers are for, please, refer toISVNExternalsHandler
.- 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.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.- 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 treespaths
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 inpaths
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 areignored
, doesn't process externals definitions as part of this operation. Ifdepth
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). Ifdepth
isSVNDepth.UNKNOWN
, takes the working depth frompaths
and then behaves as described above. IfdepthIsSticky
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'sISVNEventHandler
is non-null, it is invoked for each item handled by the update, and also for files restored from text-base. AlsoISVNCanceller.checkCancelled()
will be used at various places during the update to check whether the caller wants to stop the update. Before updating a next path frompaths
this method callsSVNBasicDelegate.handlePathListItem(File)
passing the path to it. This operation requires repository access (in case the repository is not on the same machine, network connection is established).- Parameters:
paths
- working copy pathsrevision
- revision to update todepth
- tree depth to updateallowUnversionedObstructions
- flag that allows tolerating unversioned items during updatedepthIsSticky
- flag that controls whether the requested depth should be written to the working copy- Returns:
- an array of
long
revisions with each element set to the revision to whichrevision
was resolved - Throws:
SVNException
- Since:
- 1.2, SVN 1.5
-
doUpdate
public long doUpdate(java.io.File path, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky) throws SVNException
Updates working copyto
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 toSVNRevision.HEAD
. Ifrevision
does not meet these requirements, an exception with the error codeSVNErrorCode.CLIENT_BAD_REVISION
is thrown. If externals areignored
, doesn't process externals definitions as part of this operation. Ifdepth
isSVNDepth.INFINITY
, updates fully recursively. Else if it isSVNDepth.IMMEDIATES
orSVNDepth.FILES
, updatespath
and its file entries, but not its subdirectories. Else ifSVNDepth.EMPTY
, updates exactlypath
, nonrecursively (essentially, updates the target's properties). Ifdepth
isSVNDepth.UNKNOWN
, takes the working depth frompath
and then behaves as described above. IfdepthIsSticky
is set anddepth
is notSVNDepth.UNKNOWN
, then in addition to updatingpath
, also sets its 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'sISVNEventHandler
is non-null, it is invoked for each item handled by the update, and also for files restored from text-base. AlsoISVNCanceller.checkCancelled()
will be used at various places during the update to check whether the caller wants to stop the update. This operation requires repository access (in case the repository is not on the same machine, network connection is established).- Parameters:
path
- working copy pathrevision
- revision to update todepth
- tree depth to updateallowUnversionedObstructions
- flag that allows tollerating unversioned items during updatedepthIsSticky
- flag that controls whether the requested depth should be written to the working copy- Returns:
- revision to which
revision
was resolved - Throws:
SVNException
- Since:
- 1.2, SVN 1.5
-
doSwitchImpl
private long doSwitchImpl(SVNWCAccess wcAccess, java.io.File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky) throws SVNException
- Throws:
SVNException
-
update
private long update(java.io.File path, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky, boolean sendCopyFrom) throws SVNException
- Throws:
SVNException
-
setUpdateLocksOnDemand
public void setUpdateLocksOnDemand(boolean locksOnDemand)
Sets whether working copies should be locked on demand or not during an update process.For additional description, please, refer to
isUpdateLocksOnDemand()
.- Parameters:
locksOnDemand
- true to make update lock a working copy tree on demand only (for those subdirectories only which will be changed by update)
-
isUpdateLocksOnDemand
public boolean isUpdateLocksOnDemand()
Says whether the entire working copy should be locked while updating or not. If this method returns false, then the working copy will be closed for all paths involved in the update. Otherwise only those working copy subdirectories will be locked, which will be either changed by the update or which contain deleted files that should be restored during the update; all other versioned subdirectories than won't be touched by the update will remain opened for read only access without locking. Locking working copies on demand is intended to improve update performance for large working copies because even a no-op update on a huge working copy always locks the entire tree by default. And locking a working copy tree means opening special lock files for privileged access for all subdirectories involved. This makes an update process work slower. Locking wc on demand feature suggests such a workaround to enhance update performance.- Returns:
- true when locking wc on demand
-
doSwitch
public long doSwitch(java.io.File file, SVNURL url, SVNRevision revision, boolean recursive) throws SVNException
Deprecated.Updates the Working Copy item to mirror a new URL.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
.Calling this method is equivalent to
doSwitch(file, url, SVNRevision.UNDEFINED, revision, recursive)
.- Parameters:
file
- the Working copy item to be switchedurl
- the repository location as a target against which the item will be switchedrevision
- the desired revision of the repository targetrecursive
- 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
-
doSwitch
public long doSwitch(java.io.File file, SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive) throws SVNException
Deprecated.Updates the Working Copy item to mirror a new URL.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 switchedurl
- the repository location as a target against which the item will be switchedpegRevision
- a revision in whichfile
is first looked up in the repositoryrevision
- the desired revision of the repository targetrecursive
- 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
-
doSwitch
public long doSwitch(java.io.File file, SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive, boolean force) throws SVNException
Deprecated.- Parameters:
file
-url
-pegRevision
-revision
-recursive
-force
-- Returns:
- actual revision number
- Throws:
SVNException
-
doSwitch
public long doSwitch(java.io.File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions, boolean depthIsSticky) throws SVNException
Switches working treepath
tourl
\pegRevision
atrevision
. Summary of purpose: this is normally used to switch a working directory over to another line of development, such as a branch or a tag. Switching an existing working directory is more efficient than checking outurl
from scratch.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. Ifdepth
isSVNDepth.INFINITY
, switches fully recursively. Else if it isSVNDepth.IMMEDIATES
, switchespath
and its file children (if any), and switches subdirectories but does not update them. Else ifSVNDepth.FILES
, switches just file children, ignoring subdirectories completely. Else ifSVNDepth.EMPTY
, switches justpath
and touches nothing underneath it. IfdepthIsSticky
is set anddepth
is notSVNDepth.UNKNOWN
, then in addition to switchingpath
, also sets its sticky ambient depth value todepth
. If externals areignored
, doesn't process externals definitions as part of this operation. IfallowUnversionedObstructions
is true then the switch 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 switch. Working properties of obstructing items are set equal to the base properties. IfallowUnversionedObstructions
is false then the switch will abort if there are any unversioned obstructing items. If the caller'sISVNEventHandler
is non-null, it is invoked for paths affected by the switch, and also for files restored from text-base. AlsoISVNCanceller.checkCancelled()
will be used at various places during the switch to check whether the caller wants to stop the switch. This operation requires repository access (in case the repository is not on the same machine, network connection is established).- Parameters:
path
- the Working copy item to be switchedurl
- the repository location as a target against which the item will be switchedpegRevision
- a revision in whichpath
is first looked up in the repositoryrevision
- the desired revision of the repository targetdepth
- tree depth to updateallowUnversionedObstructions
- flag that allows tolerating unversioned items during updatedepthIsSticky
- flag that controls whether the requested depth should be written into the working copy- Returns:
- value of the revision to which the working copy was actually switched
- Throws:
SVNException
- Since:
- 1.2, SVN 1.5
-
doCheckout
public long doCheckout(SVNURL url, java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision, boolean recursive) throws SVNException
Deprecated.Checks out a Working Copy from a repository.If the destination path (
dstPath
) is null then the last component ofurl
is used for the local directory name.As a revision SVNRevision's pre-defined constant fields can be used. For example, to check out a Working Copy at the latest revision of the repository use
HEAD
.- Parameters:
url
- a repository location from where a Working Copy will be checked outdstPath
- the local path where the Working Copy will be placedpegRevision
- the revision at whichurl
will be firstly seen in the repository to make sure it's the one that is neededrevision
- the desired revision of the Working Copy to be checked outrecursive
- if true andurl
is a directory then the entire tree will be checked out, otherwise if false - only items located immediately in the directory itself- Returns:
- the revision number of the Working Copy
- Throws:
SVNException
-url
refers to a file, not a directory;dstPath
already exists but it is a file, not a directory;dstPath
already exists and is a versioned directory but has a different URL (repository location against which the directory is controlled)
-
doCheckout
public long doCheckout(SVNURL url, java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision, boolean recursive, boolean force) throws SVNException
Deprecated.- Parameters:
url
-dstPath
-pegRevision
-revision
-recursive
-force
-- Returns:
- actual revision number
- Throws:
SVNException
-
doCheckout
public long doCheckout(SVNURL url, java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision, SVNDepth depth, boolean allowUnversionedObstructions) throws SVNException
Checks out a working copy ofurl
atrevision
, looked up atpegRevision
, usingdstPath
as the root directory of the newly checked out working copy. IfpegRevision
isSVNRevision.UNDEFINED
, then it defaults toSVNRevision.HEAD
.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. Ifdepth
isSVNDepth.INFINITY
, checks out fully recursively. Else if it isSVNDepth.IMMEDIATES
, checks outurl
and its immediate entries (subdirectories will be present, but will be at depthSVNDepth.EMPTY
themselves); elseSVNDepth.FILES
, checks outurl
and its file entries, but no subdirectories; else ifSVNDepth.EMPTY
, checks outurl
as an empty directory at that depth, with no entries present. Ifdepth
isSVNDepth.UNKNOWN
, then behave as if forSVNDepth.INFINITY
, except in the case of resuming a previous checkout ofdstPath
(i.e., updating), in which case uses the depth of the existing working copy. If externals areignored
, doesn't process externals definitions as part of this operation. IfallowUnversionedObstructions
is true then the checkout tolerates existing unversioned items that obstruct added paths fromurl
. 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 checkout. Working properties of obstructing items are set equal to the base properties. IfallowUnversionedObstructions
is false then the checkout will abort if there are any unversioned obstructing items. If the caller'sISVNEventHandler
is non-null, it is invoked as the checkout processes. AlsoISVNCanceller.checkCancelled()
will be used at various places during the checkout to check whether the caller wants to stop the checkout. This operation requires repository access (in case the repository is not on the same machine, network connection is established).- Parameters:
url
- a repository location from where a Working Copy will be checked outdstPath
- the local path where the Working Copy will be placedpegRevision
- the revision at whichurl
will be firstly seen in the repository to make sure it's the one that is neededrevision
- the desired revision of the Working Copy to be checked outdepth
- tree depthallowUnversionedObstructions
- flag that allows tolerating unversioned items during- Returns:
- value of the revision actually checked out from the repository
- Throws:
SVNException
-SVNErrorCode.UNSUPPORTED_FEATURE
- ifurl
refers to a file rather than a directorySVNErrorCode.RA_ILLEGAL_URL
- ifurl
does not exist- Since:
- 1.2, SVN 1.5
-
doExport
public long doExport(SVNURL url, java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision, java.lang.String eolStyle, boolean force, boolean recursive) throws SVNException
Exports a clean directory or single file from a repository.If
eolStyle
is not null then it should denote a specific End-Of-Line marker for the files to be exported. Significant values foreolStyle
are:- "CRLF" (Carriage Return Line Feed) - this causes files to contain '\r\n' line ending sequences for EOL markers, regardless of the operating system in use (for instance, this EOL marker is used by software on the Windows platform).
- "LF" (Line Feed) - this causes files to contain '\n' line ending sequences for EOL markers, regardless of the operating system in use (for instance, this EOL marker is used by software on the Unix platform).
- "CR" (Carriage Return) - this causes files to contain '\r' line ending sequences for EOL markers, regardless of the operating system in use (for instance, this EOL marker was used by software on older Macintosh platforms).
- "native" - this causes files to contain the EOL markers that are native to the operating system on which SVNKit is run.
- Parameters:
url
- a repository location from where the unversioned directory/file will be exporteddstPath
- the local path where the repository items will be exported topegRevision
- the revision at whichurl
will be firstly seen in the repository to make sure it's the one that is neededrevision
- the desired revision of the directory/file to be exportedeolStyle
- a string that denotes a specific End-Of-Line character;force
- true to fore the operation even if there are local files with the same names as those in the repository (local ones will be replaced)recursive
- if true andurl
is a directory then the entire tree will be exported, otherwise if false - only items located immediately in the directory itself- Returns:
- the revision number of the exported directory/file
- Throws:
SVNException
-
doExport
public long doExport(SVNURL url, java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision, java.lang.String eolStyle, boolean overwrite, SVNDepth depth) throws SVNException
Exports the contents of a subversion repository into a 'clean' directory (meaning a directory with no administrative directories).pegRevision
is the revision where the path is first looked up. IfpegRevision
isSVNRevision.UNDEFINED
, then it defaults toSVNRevision.HEAD
. If externals areignored
, doesn't process externals definitions as part of this operation.eolStyle
allows you to override the standard eol marker on the platform you are running on. Can be either "LF", "CR" or "CRLF" or null. If null will use the standard eol marker. Any other value will cause an exception with the error codeSVNErrorCode.IO_UNKNOWN_EOL
error to be returned.If
depth
isSVNDepth.INFINITY
, exports fully recursively. Else if it isSVNDepth.IMMEDIATES
, exportsurl
and its immediate children (if any), but with subdirectories empty and atSVNDepth.EMPTY
. Else ifSVNDepth.FILES
, exportsurl
and its immediate file children (if any) only. Ifdepth
isSVNDepth.EMPTY
, then exports exactlyurl
and none of its children.- Parameters:
url
- repository url to export fromdstPath
- path to export topegRevision
- the revision at whichurl
will be firstly seen in the repository to make sure it's the one that is neededrevision
- the desired revision of the directory/file to be exportedeolStyle
- a string that denotes a specific End-Of-Line characteroverwrite
- if true, will cause the export to overwrite files or directoriesdepth
- tree depth- Returns:
- value of the revision actually exported
- Throws:
SVNException
- Since:
- 1.2, SVN 1.5
-
doExport
public long doExport(java.io.File srcPath, java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision, java.lang.String eolStyle, boolean force, boolean recursive) throws SVNException
Exports a clean directory or single file from eihter a source Working Copy or a repository.How this method works:
- If
revision
is different fromBASE
,WORKING
,COMMITTED
,UNDEFINED
- then the repository origin ofsrcPath
will be exported (what is done by "remote"doExport()
). - In other cases a clean unversioned copy of
srcPath
- either a directory or a single file - is exported todstPath
.
If
eolStyle
is not null then it should denote a specific End-Of-Line marker for the files to be exported. Significant values foreolStyle
are:- "CRLF" (Carriage Return Line Feed) - this causes files to contain '\r\n' line ending sequences for EOL markers, regardless of the operating system in use (for instance, this EOL marker is used by software on the Windows platform).
- "LF" (Line Feed) - this causes files to contain '\n' line ending sequences for EOL markers, regardless of the operating system in use (for instance, this EOL marker is used by software on the Unix platform).
- "CR" (Carriage Return) - this causes files to contain '\r' line ending sequences for EOL markers, regardless of the operating system in use (for instance, this EOL marker was used by software on older Macintosh platforms).
- "native" - this causes files to contain the EOL markers that are native to the operating system on which SVNKit is run.
- Parameters:
srcPath
- a repository location from where the unversioned directory/file will be exporteddstPath
- the local path where the repository items will be exported topegRevision
- the revision at whichurl
will be firstly seen in the repository to make sure it's the one that is neededrevision
- the desired revision of the directory/file to be exportedeolStyle
- a string that denotes a specific End-Of-Line character;force
- true to fore the operation even if there are local files with the same names as those in the repository (local ones will be replaced)recursive
- if true andurl
is a directory then the entire tree will be exported, otherwise if false - only items located immediately in the directory itself- Returns:
- the revision number of the exported directory/file
- Throws:
SVNException
- If
-
doExport
public long doExport(java.io.File srcPath, java.io.File dstPath, SVNRevision pegRevision, SVNRevision revision, java.lang.String eolStyle, boolean overwrite, SVNDepth depth) throws SVNException
Exports the contents of either a subversion repository or a subversion working copy into a 'clean' directory (meaning a directory with no administrative directories).pegRevision
is the revision where the path is first looked up when exporting from a repository. IfpegRevision
isSVNRevision.UNDEFINED
, then it defaults toSVNRevision.WORKING
. Ifrevision
is one of: then local export is performed. Otherwise exporting from the repository. If externals areignored
, doesn't process externals definitions as part of this operation.eolStyle
allows you to override the standard eol marker on the platform you are running on. Can be either "LF", "CR" or "CRLF" or null. If null will use the standard eol marker. Any other value will cause an exception with the error codeSVNErrorCode.IO_UNKNOWN_EOL
error to be returned.If
depth
isSVNDepth.INFINITY
, exports fully recursively. Else if it isSVNDepth.IMMEDIATES
, exportssrcPath
and its immediate children (if any), but with subdirectories empty and atSVNDepth.EMPTY
. Else ifSVNDepth.FILES
, exportssrcPath
and its immediate file children (if any) only. Ifdepth
isSVNDepth.EMPTY
, then exports exactlysrcPath
and none of its children.- Parameters:
srcPath
- working copy pathdstPath
- path to export topegRevision
- the revision at whichurl
will be firstly seen in the repository to make sure it's the one that is neededrevision
- the desired revision of the directory/file to be exported; used only when exporting from a repositoryeolStyle
- a string that denotes a specific End-Of-Line characteroverwrite
- if true, will cause the export to overwrite files or directoriesdepth
- tree depth- Returns:
- value of the revision actually exported
- Throws:
SVNException
- Since:
- 1.2, SVN 1.5
-
doRelocate
public void doRelocate(java.io.File dst, SVNURL oldURL, SVNURL newURL, boolean recursive) throws SVNException
Substitutes the beginning part of a Working Copy's URL with a new one.When a repository root location or a URL schema is changed the old URL of the Working Copy which starts with
oldURL
should be substituted for a new URL beginning -newURL
.- Parameters:
dst
- a Working Copy item's patholdURL
- the old beginning part of the repository's URL that should be overwrittennewURL
- a new beginning part for the repository location that will overwriteoldURL
recursive
- if true anddst
is a directory then the entire tree will be relocated, otherwise if false - onlydst
itself- Throws:
SVNException
-
doCanonicalizeURLs
public void doCanonicalizeURLs(java.io.File dst, boolean omitDefaultPort, boolean recursive) throws SVNException
Canonicalizes all urls in the specified Working Copy.- Parameters:
dst
- a WC pathomitDefaultPort
- if true then removes all port numbers from urls which equal to default ones, otherwise does notrecursive
- recurses an operation- Throws:
SVNException
-
setExportExpandsKeywords
public void setExportExpandsKeywords(boolean expand)
Sets whether keywords must be expanded during an export operation.- Parameters:
expand
- true to expand; otherwise false- Since:
- 1.3
-
isExportExpandsKeywords
public boolean isExportExpandsKeywords()
Says whether keywords expansion during export operations is turned on or not.- Returns:
- true if expanding keywords; false otherwise
- Since:
- 1.3
-
copyVersionedDir
private void copyVersionedDir(java.io.File from, java.io.File to, SVNRevision revision, java.lang.String eolStyle, boolean force, SVNDepth depth) throws SVNException
- Throws:
SVNException
-
copyVersionedFile
private void copyVersionedFile(java.io.File dstPath, SVNAdminArea adminArea, java.lang.String fileName, SVNRevision revision, java.lang.String eol) throws SVNException
- Throws:
SVNException
-
doRemoteExport
private long doRemoteExport(SVNRepository repository, long revNumber, java.io.File dstPath, java.lang.String eolStyle, boolean force, SVNDepth depth) throws SVNException
- Throws:
SVNException
-
doCanonicalizeURLs
private void doCanonicalizeURLs(SVNAdminAreaInfo adminAreaInfo, SVNAdminArea adminArea, java.lang.String name, boolean omitDefaultPort, boolean recursive) throws SVNException
- Throws:
SVNException
-
canonicalizeExtenrals
public static java.lang.String canonicalizeExtenrals(java.lang.String externals, boolean omitDefaultPort) throws SVNException
- Throws:
SVNException
-
canonicalizeEntry
private static boolean canonicalizeEntry(SVNEntry entry, boolean omitDefaultPort) throws SVNException
- Throws:
SVNException
-
canonicalizeURL
public static SVNURL canonicalizeURL(SVNURL url, boolean omitDefaultPort) throws SVNException
- Throws:
SVNException
-
handleExternals
private void handleExternals(SVNWCAccess wcAccess, java.io.File root, java.util.Map oldExternals, java.util.Map newExternals, java.util.Map depths, SVNURL fromURL, SVNURL rootURL, SVNDepth requestedDepth, boolean isExport, boolean updateUnchanged) throws SVNException
- Throws:
SVNException
-
getOwnerURL
private SVNURL getOwnerURL(java.io.File root)
-
handleExternalItemChange
private void handleExternalItemChange(SVNWCAccess access, java.lang.String targetDir, SVNUpdateClient16.ExternalDiff externalDiff) throws SVNException
- Throws:
SVNException
-
handleExternalChange
private void handleExternalChange(SVNWCAccess access, java.lang.String targetDir, SVNUpdateClient16.ExternalDiff externalDiff) throws SVNException
oldURL is null when externals is added: jsvn ps svn:externals "path URL" . jsvn up . newURL is null when external is deleted: jsvn pd svn:externals . jsvn up . Also newURL or oldURL could be null, when external property is added or removed by update itself (someone else has changed it). For instance, oldURL is always null during checkout or export operation.- Throws:
SVNException
-
switchFileExternal
private void switchFileExternal(SVNWCAccess wcAccess, java.io.File path, SVNURL url, SVNRevision pegRevision, SVNRevision revision, SVNURL reposRootURL) throws SVNException
- Throws:
SVNException
-
deleteExternal
private void deleteExternal(java.io.File external) throws SVNException
- Throws:
SVNException
-
validateRelocateTargetURL
private java.util.Map validateRelocateTargetURL(SVNURL targetURL, java.lang.String expectedUUID, java.util.Map validatedURLs, boolean isRoot) throws SVNException
- Throws:
SVNException
-
relocateEntry
private java.util.Map relocateEntry(SVNEntry entry, java.lang.String from, java.lang.String to, java.util.Map validatedURLs) throws SVNException
- Throws:
SVNException
-
doRelocate
private java.util.Map doRelocate(SVNAdminArea adminArea, java.lang.String name, java.lang.String from, java.lang.String to, boolean recursive, java.util.Map validatedURLs) throws SVNException
- Throws:
SVNException
-
-