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 oftarget
toswitchTarget
\switchTarget
'spegRevision
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 outswitchTarget
from scratch. Ifdepth
isSVNDepth.INFINITY
, switches fully recursively. Else if it isSVNDepth.IMMEDIATES
, switchestarget
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 justtarget
and touches nothing underneath it. If externals are ignored (ignoreExternals
istrue
), doesn't process externals definitions as part of this operation. IfallowUnversionedObstructions
istrue
then 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. IfallowUnversionedObstructions
isfalse
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).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_FEATURE
error code - iftarget
is not in the repository yet exception withSVNErrorCode.ENTRY_MISSING_URL
error code - ifswitchTarget
directory has no URL exception withSVNErrorCode.WC_INVALID_SWITCH
error code - ifswitchTarget
is not the same repository astarget
's repository exception withSVNErrorCode.CLIENT_UNRELATED_RESOURCES
error code - ifignoreAncestry
isfalse
andswitchTarget
shares no common ancestry withtarget
- Version:
- 1.7
- Author:
- TMate Software Ltd.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SvnSwitch(SvnOperationFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
ensureArgumentsAreValid()
SvnTarget
getSwitchTarget()
Returns the repository location as a target against which the item will be switched.boolean
isChangesWorkingCopy()
Gets whether the operation changes working copyboolean
isDepthIsSticky()
Returns whether depth is sticky.boolean
isIgnoreAncestry()
Returns whether to ignore ancestry when calculating merges.void
setDepthIsSticky(boolean depthIsSticky)
Sets whether depth is sticky.void
setIgnoreAncestry(boolean ignoreAncestry)
Sets whether to ignore ancestry when calculating merges.void
setSwitchTarget(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. IfdepthIsSticky
is set the operation will usedepth
as status scope, otherwiseSVNDepth.UNKNOWN
will be used.- Returns:
true
if the depth is sticky, otherwisefalse
-
isIgnoreAncestry
public boolean isIgnoreAncestry()
Returns whether to ignore ancestry when calculating merges.- Returns:
true
if 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. IfdepthIsSticky
is set the operation will usedepth
as status scope, otherwiseSVNDepth.UNKNOWN
will be used.- Parameters:
depthIsSticky
-true
if the depth is sticky, otherwisefalse
-
setIgnoreAncestry
public void setIgnoreAncestry(boolean ignoreAncestry)
Sets whether to ignore ancestry when calculating merges.- Parameters:
ignoreAncestry
-true
if 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:
ensureArgumentsAreValid
in classSvnOperation<java.lang.Long>
- Throws:
SVNException
-
isChangesWorkingCopy
public boolean isChangesWorkingCopy()
Gets whether the operation changes working copy- Overrides:
isChangesWorkingCopy
in classSvnOperation<java.lang.Long>
- Returns:
true
if the operation changes the working copy, otherwisefalse
-
-