Package org.tmatesoft.svn.core.wc2
Class SvnSwitch
- All Implemented Interfaces:
ISvnOperationOptionsProvider
Represents switch operation.
Switches working tree of
target
to switchTarget
\
switchTarget
's pegRevision
at revision
.
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 out
switchTarget
from scratch.
If depth
is SVNDepth.INFINITY
, switches fully
recursively. Else if it is SVNDepth.IMMEDIATES
, switches
target
and its file children (if any), and switches
subdirectories but does not update them. Else if SVNDepth.FILES
,
switches just file children, ignoring subdirectories completely. Else if
SVNDepth.EMPTY
, switches just target
and touches
nothing underneath it.
If externals are ignored (ignoreExternals
is true
), doesn't process
externals definitions as part of this operation.
If allowUnversionedObstructions
is true
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. If
allowUnversionedObstructions
is false
then the switch will abort if there are
any unversioned obstructing items.
If the caller's ISVNEventHandler
is non-null
, it is invoked for paths affected by the
switch, and also for files restored from text-base. Also
ISVNCanceller.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 - if target
is not in the repository yet
exception with SVNErrorCode.ENTRY_MISSING_URL
error code
- if switchTarget
directory has no URL
exception with SVNErrorCode.WC_INVALID_SWITCH
error code
- if switchTarget
is not the same repository as target
's repository
exception with SVNErrorCode.CLIENT_UNRELATED_RESOURCES
error code
- if ignoreAncestry
is false
and
switchTarget
shares no common ancestry with target
- Version:
- 1.7
- Author:
- TMate Software Ltd.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Returns the repository location as a target against which the item will be switched.boolean
Gets whether the operation changes working copyboolean
Returns whether depth is sticky.boolean
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 Details
-
SvnSwitch
-
-
Method Details
-
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
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
Sets the repository location as a target against which the item will be switched.- Parameters:
switchTarget
- switch target
-
ensureArgumentsAreValid
- Overrides:
ensureArgumentsAreValid
in classSvnOperation<Long>
- Throws:
SVNException
-
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
-