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.HEADrevision. 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. Thetargetscan 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.HEADwill remain the same as each path is updated. If externals are ignored (ignoreExternalsistrue), doesn't process externals definitions as part of this operation. IfdepthisSVNDepth.INFINITY, updates fully recursively. Else if it isSVNDepth.IMMEDIATESorSVNDepth.FILES, updates eachtargetand its file entries, but not its subdirectories. Else ifSVNDepth.EMPTY, updates exactly each target, nonrecursively (essentially, updates the target's properties). IfdepthisSVNDepth.UNKNOWN, takes the working depth frompathsand then behaves as described above. IfdepthIsStickyis set anddepthis notSVNDepth.UNKNOWN, then in addition to updatingpaths, also sets their sticky ambient depth value todepth. IfallowUnversionedObstructionsistruethen 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. IfallowUnversionedObstructionsisfalsethen the update will abort if there are any unversioned obstructing items. If the operation'sISVNEventHandleris 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 oflongrevisions with each element set to the revision to whichrevisionwas resolved.SvnOperation.run()throwsSVNExceptionin the following cases:-
exception with
SVNErrorCode.ILLEGAL_TARGETerror code - iftargetis not a local path exception withSVNErrorCode.RA_ILLEGAL_URLerror code - if external item at therevisiondoesn't exist, or if external item at therevisionis not file or a directory exception withSVNErrorCode.ENTRY_MISSING_URLerror code - if working copy item that has no URL- Version:
- 1.7
- Author:
- TMate Software Ltd.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSvnUpdate(SvnOperationFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidensureArgumentsAreValid()protected intgetMaximumTargetsCount()booleanisChangesWorkingCopy()Gets whether the operation changes working copybooleanisDepthIsSticky()Gets whether or not the requested depth should be written to the working copy.booleanisMakeParents()Gets whether or not intermediate directories should be made.booleanisTreatAddsAsModifications()Gets whether or not adds should be treated as modifications.voidsetDepthIsSticky(boolean depthIsSticky)Sets whether or not the requested depth should be written to the working copy.voidsetMakeParents(boolean makeParents)Sets whether or not intermediate directories should be made.voidsetTreatAddsAsModifications(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:
ensureArgumentsAreValidin classSvnOperation<long[]>- Throws:
SVNException
-
isDepthIsSticky
public boolean isDepthIsSticky()
Gets whether or not the requested depth should be written to the working copy.- Returns:
trueif 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-trueif 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:
trueif intermediate directories should be made, otherwisefalse
-
setMakeParents
public void setMakeParents(boolean makeParents)
Sets whether or not intermediate directories should be made.- Parameters:
makeParents-trueif intermediate directories should be made, otherwisefalse
-
isTreatAddsAsModifications
public boolean isTreatAddsAsModifications()
Gets whether or not adds should be treated as modifications.- Returns:
trueif 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-trueif adds should be treated as modifications, otherwisefalse
-
getMaximumTargetsCount
protected int getMaximumTargetsCount()
- Overrides:
getMaximumTargetsCountin classSvnOperation<long[]>
-
isChangesWorkingCopy
public boolean isChangesWorkingCopy()
Gets whether the operation changes working copy- Overrides:
isChangesWorkingCopyin classSvnOperation<long[]>- Returns:
trueif the operation changes the working copy, otherwisefalse
-
-