Package org.tmatesoft.svn.core.wc2

# Class SvnRevert

java.lang.Object
org.tmatesoft.svn.core.wc2.SvnOperation<Void>
org.tmatesoft.svn.core.wc2.SvnRevert

All Implemented Interfaces:
  `ISvnOperationOptionsProvider`

public class SvnRevert extends SvnOperation<Void>
Represents revert operation. Restores the pristine version of working copy `targets`, effectively undoing any local mods. For each path in `targets`, reverts it if it is a file. Else if it is a directory, reverts according to `depth`:

If depth is `SVNDepth.EMPTY`, reverts just the properties on the directory; else if `SVNDepth.FILES`, reverts the properties and any files immediately under the directory; else if `SVNDepth.IMMEDIATES`, reverts all of the preceding plus properties on immediate subdirectories; else if `SVNDepth.INFINITY`, reverts path and everything under it fully recursively.

`changeLists` is a collection of `String` changelist names, used as a restrictive filter on items reverted; that is, doesn't revert any item unless it's a member of one of those changelists. If `changeLists` is empty (or `null`), no changelist filtering occurs.

If an item specified for reversion is not under version control, then does not fail with an exception, just invokes `ISVNEventHandler` using notification code `SVNEventAction.SKIP`.

Version:
  1.7
Author:
  TMate Software Ltd.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`SvnRevert(SvnOperationFactory factory)`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`ensureArgumentsAreValid()`
`protected int`
`getMaximumTargetsCount()`
`boolean`
`isChangesWorkingCopy()`
Gets whether the operation changes working copy
`boolean`
`isClearChangelists()`
`boolean`
`isMetadataOnly()`
`boolean`
`isPreserveModifiedCopies()`
`boolean`
`isRevertMissingDirectories()`
`void`
`setClearChangelists(boolean clearChangelists)`
`void`
`setMetadataOnly(boolean metadataOnly)`
`void`
`setPreserveModifiedCopies(boolean preserveModifiedCopies)`
`void`
`setRevertMissingDirectories(boolean revertMissingDirectories)`

### 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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SvnRevert

protected SvnRevert(SvnOperationFactory factory)

## Method Details

### isRevertMissingDirectories

public boolean isRevertMissingDirectories()

### setRevertMissingDirectories

public void setRevertMissingDirectories(boolean revertMissingDirectories)

### isPreserveModifiedCopies

public boolean isPreserveModifiedCopies()

### setPreserveModifiedCopies

public void setPreserveModifiedCopies(boolean preserveModifiedCopies)

### isClearChangelists

public boolean isClearChangelists()

### setClearChangelists

public void setClearChangelists(boolean clearChangelists)

### isMetadataOnly

public boolean isMetadataOnly()

### setMetadataOnly

public void setMetadataOnly(boolean metadataOnly)

### ensureArgumentsAreValid

protected void ensureArgumentsAreValid() throws SVNException

Overrides:
  `ensureArgumentsAreValid` in class `SvnOperation<Void>`
Throws:
  `SVNException`

### getMaximumTargetsCount

protected int getMaximumTargetsCount()

Overrides:
  `getMaximumTargetsCount` in class `SvnOperation<Void>`

### isChangesWorkingCopy

public boolean isChangesWorkingCopy()
Gets whether the operation changes working copy

Overrides:
  `isChangesWorkingCopy` in class `SvnOperation<Void>`
Returns:
  `true` if the operation changes the working copy, otherwise `false`