Package org.tmatesoft.svn.core.wc2
Class SvnSwitch
- java.lang.Object
-
- org.tmatesoft.svn.core.wc2.SvnOperation<V>
-
- org.tmatesoft.svn.core.wc2.AbstractSvnUpdate<java.lang.Long>
-
- org.tmatesoft.svn.core.wc2.SvnSwitch
-
- All Implemented Interfaces:
ISvnOperationOptionsProvider
public class SvnSwitch extends AbstractSvnUpdate<java.lang.Long>
Represents switch operation. Switches working tree oftargettoswitchTarget\switchTarget'spegRevisionatrevision. 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 outswitchTargetfrom scratch. IfdepthisSVNDepth.INFINITY, switches fully recursively. Else if it isSVNDepth.IMMEDIATES, switchestargetand 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 justtargetand touches nothing underneath it. If externals are ignored (ignoreExternalsistrue), doesn't process externals definitions as part of this operation. IfallowUnversionedObstructionsistruethen the switch 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 switch. Working properties of obstructing items are set equal to the base properties. IfallowUnversionedObstructionsisfalsethen the switch will abort if there are any unversioned obstructing items. If the caller'sISVNEventHandleris 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).SvnOperation.run()method returns value of the revision value to which the working copy was actually switched.SvnOperation.run()method returns value of the revision to which the working copy was actually switched.-
exception with
SVNErrorCode.UNSUPPORTED_FEATUREerror code - iftargetis not in the repository yet exception withSVNErrorCode.ENTRY_MISSING_URLerror code - ifswitchTargetdirectory has no URL exception withSVNErrorCode.WC_INVALID_SWITCHerror code - ifswitchTargetis not the same repository astarget's repository exception withSVNErrorCode.CLIENT_UNRELATED_RESOURCESerror code - ifignoreAncestryisfalseandswitchTargetshares no common ancestry withtarget- Version:
- 1.7
- Author:
- TMate Software Ltd.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSvnSwitch(SvnOperationFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidensureArgumentsAreValid()SvnTargetgetSwitchTarget()Returns the repository location as a target against which the item will be switched.booleanisChangesWorkingCopy()Gets whether the operation changes working copybooleanisDepthIsSticky()Returns whether depth is sticky.booleanisIgnoreAncestry()Returns whether to ignore ancestry when calculating merges.voidsetDepthIsSticky(boolean depthIsSticky)Sets whether depth is sticky.voidsetIgnoreAncestry(boolean ignoreAncestry)Sets whether to ignore ancestry when calculating merges.voidsetSwitchTarget(SvnTarget switchTarget)Sets the repository location as a target against which the item will be switched.-
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, getMaximumTargetsCount, 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
-
SvnSwitch
protected SvnSwitch(SvnOperationFactory factory)
-
-
Method Detail
-
isDepthIsSticky
public boolean isDepthIsSticky()
Returns whether depth is sticky. IfdepthIsStickyis set the operation will usedepthas status scope, otherwiseSVNDepth.UNKNOWNwill be used.- Returns:
trueif the depth is sticky, otherwisefalse
-
isIgnoreAncestry
public boolean isIgnoreAncestry()
Returns whether to ignore ancestry when calculating merges.- Returns:
trueif ancestry should be ignored, otherwisefalse- Since:
- 1.7, Subversion 1.7
-
getSwitchTarget
public SvnTarget getSwitchTarget()
Returns the repository location as a target against which the item will be switched.- Returns:
- switch target
-
setDepthIsSticky
public void setDepthIsSticky(boolean depthIsSticky)
Sets whether depth is sticky. IfdepthIsStickyis set the operation will usedepthas status scope, otherwiseSVNDepth.UNKNOWNwill be used.- Parameters:
depthIsSticky-trueif the depth is sticky, otherwisefalse
-
setIgnoreAncestry
public void setIgnoreAncestry(boolean ignoreAncestry)
Sets whether to ignore ancestry when calculating merges.- Parameters:
ignoreAncestry-trueif ancestry should be ignored, otherwisefalse- Since:
- 1.7, Subversion 1.7
-
setSwitchTarget
public void setSwitchTarget(SvnTarget switchTarget)
Sets the repository location as a target against which the item will be switched.- Parameters:
switchTarget- switch target
-
ensureArgumentsAreValid
protected void ensureArgumentsAreValid() throws SVNException- Overrides:
ensureArgumentsAreValidin classSvnOperation<java.lang.Long>- Throws:
SVNException
-
isChangesWorkingCopy
public boolean isChangesWorkingCopy()
Gets whether the operation changes working copy- Overrides:
isChangesWorkingCopyin classSvnOperation<java.lang.Long>- Returns:
trueif the operation changes the working copy, otherwisefalse
-
-