Package org.tmatesoft.svn.core.wc2
Class SvnUpdate
- java.lang.Object
-
- org.tmatesoft.svn.core.wc2.SvnOperation<V>
-
- org.tmatesoft.svn.core.wc2.AbstractSvnUpdate<long[]>
-
- org.tmatesoft.svn.core.wc2.SvnUpdate
-
- All Implemented Interfaces:
ISvnOperationOptionsProvider
public class SvnUpdate extends AbstractSvnUpdate<long[]>
Represents update operation. Updates working copy torevision
. If no revision is given, it brings working copy up-to-date withSVNRevision.HEAD
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. Thetargets
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 (ignoreExternals
istrue
), doesn't process externals definitions as part of this operation. Ifdepth
isSVNDepth.INFINITY
, updates fully recursively. Else if it isSVNDepth.IMMEDIATES
orSVNDepth.FILES
, updates eachtarget
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
. IfallowUnversionedObstructions
istrue
then the update tolerates existing unversioned items that obstruct added paths. Only obstructions of the same type (file or directory) 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
isfalse
then the update will abort if there are any unversioned obstructing items. If the operation'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).SvnOperation.run()
method returns an array oflong
revisions with each element set to the revision to whichrevision
was resolved.SvnOperation.run()
throwsSVNException
in the following cases:-
exception with
SVNErrorCode.ILLEGAL_TARGET
error code - iftarget
is not a local path exception withSVNErrorCode.RA_ILLEGAL_URL
error code - if external item at therevision
doesn't exist, or if external item at therevision
is not file or a directory exception withSVNErrorCode.ENTRY_MISSING_URL
error code - if working copy item that has no URL- Version:
- 1.7
- Author:
- TMate Software Ltd.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SvnUpdate(SvnOperationFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
ensureArgumentsAreValid()
protected int
getMaximumTargetsCount()
boolean
isChangesWorkingCopy()
Gets whether the operation changes working copyboolean
isDepthIsSticky()
Gets whether or not the requested depth should be written to the working copy.boolean
isMakeParents()
Gets whether or not intermediate directories should be made.boolean
isTreatAddsAsModifications()
Gets whether or not adds should be treated as modifications.void
setDepthIsSticky(boolean depthIsSticky)
Sets whether or not the requested depth should be written to the working copy.void
setMakeParents(boolean makeParents)
Sets whether or not intermediate directories should be made.void
setTreatAddsAsModifications(boolean treatAddsAsModifications)
Sets whether or not adds should be treated as modifications.-
Methods inherited from class org.tmatesoft.svn.core.wc2.AbstractSvnUpdate
getExternalsHandler, isAllowUnversionedObstructions, isIgnoreExternals, isUpdateLocksOnDemand, setAllowUnversionedObstructions, setExternalsHandler, setIgnoreExternals, setUpdateLocksOnDemand
-
Methods inherited from class org.tmatesoft.svn.core.wc2.SvnOperation
addTarget, cancel, ensureEnoughTargets, ensureHomohenousTargets, getApplicableChangelists, getAuthenticationManager, getCanceller, getDepth, getEventHandler, getFirstTarget, getMinimumTargetsCount, getOperationalWorkingCopy, getOperationFactory, getOptions, getRepositoryPool, getRevision, getSqliteJournalMode, getTargets, hasFileTargets, hasLocalTargets, hasRemoteTargets, initDefaults, isCancelled, isSleepForTimestamp, isUseParentWcFormat, needsHomohenousTargets, run, setApplicalbeChangelists, setDepth, setRevision, setSingleTarget, setSleepForTimestamp, setSqliteJournalMode
-
-
-
-
Constructor Detail
-
SvnUpdate
protected SvnUpdate(SvnOperationFactory factory)
-
-
Method Detail
-
ensureArgumentsAreValid
protected void ensureArgumentsAreValid() throws SVNException
- Overrides:
ensureArgumentsAreValid
in classSvnOperation<long[]>
- Throws:
SVNException
-
isDepthIsSticky
public boolean isDepthIsSticky()
Gets whether or not the requested depth should be written to the working copy.- Returns:
true
if the requested depth should be written to the working copy, otherwisefalse
-
setDepthIsSticky
public void setDepthIsSticky(boolean depthIsSticky)
Sets whether or not the requested depth should be written to the working copy.- Parameters:
depthIsSticky
-true
if the requested depth should be written to the working copy, otherwisefalse
-
isMakeParents
public boolean isMakeParents()
Gets whether or not intermediate directories should be made.- Returns:
true
if intermediate directories should be made, otherwisefalse
-
setMakeParents
public void setMakeParents(boolean makeParents)
Sets whether or not intermediate directories should be made.- Parameters:
makeParents
-true
if intermediate directories should be made, otherwisefalse
-
isTreatAddsAsModifications
public boolean isTreatAddsAsModifications()
Gets whether or not adds should be treated as modifications.- Returns:
true
if adds should be treated as modifications, otherwisefalse
-
setTreatAddsAsModifications
public void setTreatAddsAsModifications(boolean treatAddsAsModifications)
Sets whether or not adds should be treated as modifications.- Parameters:
treatAddsAsModifications
-true
if adds should be treated as modifications, otherwisefalse
-
getMaximumTargetsCount
protected int getMaximumTargetsCount()
- Overrides:
getMaximumTargetsCount
in classSvnOperation<long[]>
-
isChangesWorkingCopy
public boolean isChangesWorkingCopy()
Gets whether the operation changes working copy- Overrides:
isChangesWorkingCopy
in classSvnOperation<long[]>
- Returns:
true
if the operation changes the working copy, otherwisefalse
-
-