Svn Selectors

Table of Content

svnAdded File selector that performs discrimination based on the 'added' subversion status.
svnModified File selector that performs discrimination based on the 'modified' subversion status.
svnUnversioned File selector that performs discrimination based on the 'unversioned' subversion status.
svnConflicted File selector that performs discrimination based on the 'conflicted' subversion status.
svnIgnored File selector that performs discrimination based on the 'ignored' subversion status.
svnLocked File selector that performs discrimination based on the 'locked' subversion status.
svnNormal File selector that performs discrimination based on the 'normal' subversion status.
svnReplaced File selector that performs discrimination based on the 'replaced' subversion status.
svnMissing File selector that performs discrimination based on the 'missing' subversion status.
svnDeleted File selector that performs discrimination based on the 'deleted' subversion status.

Introduction

This document describes the file selectors offered in svnAnt. To use those selectors, you must first obtain a copy of svnant.jar, add it to the classpath of your ant project and define the types. Fortunately, there is a resource file, within the distributed JAR file, and all those steps can be accomplished with the following code:

				
<path id="svnant.classpath">
  <pathelement location="${svnant.dir}/lib/svnant.jar" />
  <pathelement location="${svnant.dir}/lib/svnClientAdapter.jar" />
</path>  

<typedef resource="svntypes.xml" classpathref="project.classpath"/>
				
			

If you are upgrading from an earlier version of svnAnt, and the following line was used in your build.xml file, then replace it with the ones above.

				
<taskdef resource="svntask.properties" classpathref="svnant.classpath"/>
				
			

Bindings

All file selectors offer two parameters: javahl and svnkit. Those parameters are booleans, which means their values can be set to either true or false. If not specified, those parameters are assumed to be set (true). These two parameters are used to select which client is used to access Subversion.

There are three clients used by svnAnt to access Subversion:

To better understand the difference between those three clients, please refer to documentation on svnClientAdapter.jar.

The property javahl is considered only if the javahl libraries are available. Similarly, the property svnkit is considered only if SVNKit is present. Finally, javahl takes precedence over svnkit.

To better illustrate the previous paragraph, use the following steps:

  1. If javahl is true and JavaHL bindings are available, then JavaHL is used.
  2. If svnkit is true and SVNKit is present, then SVNKit is used.
  3. If the two previous tests failed, for any reason, then the Command Line Interface is used.

svnAdded

File selector that performs discrimination based on the 'added' subversion status.

Implementation: org.tigris.subclipse.svnant.selectors.Added

Parameters

Attribute Description Required
javahl If set, instructs the use of JavaHL bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
svnkit If set, instructs the use of SVNKit bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
failonerror Controls whether an error stops the build or is merely reported to the screen. No (defaults to "true")

Nested Types

No nested types defined for this type.

Description

This file selector is used to discriminate files within a fileset based on a Subversion status. In particular, this selector keeps files that are recognized as 'added'.

An 'added' file or directory is one that has been added to the repository, but not yet commited. In general, svn status displays those items with the letter A preceeding the name.

Example: to copy a number of files with the status 'added' from their location in workingcopy to a new directory called test, the following ant task can be used:


<copy todir="test">
	<fileset dir="workingcopy">
		<svnAdded/>
	</fileset>
</copy>
					
				

svnModified

File selector that performs discrimination based on the 'modified' subversion status.

Implementation: org.tigris.subclipse.svnant.selectors.Modified

Parameters

Attribute Description Required
javahl If set, instructs the use of JavaHL bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
svnkit If set, instructs the use of SVNKit bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
failonerror Controls whether an error stops the build or is merely reported to the screen. No (defaults to "true")

Nested Types

No nested types defined for this type.

Description

This file selector is used to discriminate files within a fileset based on a Subversion status. In particular, this selector keeps files that are recognized as 'modified'.

A 'modified' file or directory is one that has been changed since the last update and where the changes have not yet been commited to the repository. In general, svn status display those items with the letter M preceeding the name. It is important to note that other items can also be considered modified, such as conflicted ones.

Example: to copy a number of files with the status 'modified' from their location in workingcopy to a new directory called test, the following ant task can be used:


<copy todir="test">
	<fileset dir="workingcopy">
		<svnModified/>
	</fileset>
</copy>
					
				

svnUnversioned

File selector that performs discrimination based on the 'unversioned' subversion status.

Implementation: org.tigris.subclipse.svnant.selectors.Unversioned

Parameters

Attribute Description Required
javahl If set, instructs the use of JavaHL bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
svnkit If set, instructs the use of SVNKit bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
failonerror Controls whether an error stops the build or is merely reported to the screen. No (defaults to "true")

Nested Types

No nested types defined for this type.

Description

This file selector is used to discriminate files within a fileset based on a Subversion status. In particular, this selector keeps files that are recognized as 'unversioned'.

An 'unversioned' file or directory is one that is present in a working copy but is not yet known to the repository. In general, svn status display those items with a question mark (?) preceeding the name. Note that 'ignored' items are not considered 'unversioned'.

Eexample: to copy a number of files with the status 'unversioned' from their location in workingcopy to a new directory called test, the following ant task can be used:


<copy todir="test">
	<fileset dir="workingcopy">
		<svnUnversioned/>
	</fileset>
</copy>
		
				

svnConflicted

File selector that performs discrimination based on the 'conflicted' subversion status.

Implementation: org.tigris.subclipse.svnant.selectors.Conflicted

Parameters

Attribute Description Required
javahl If set, instructs the use of JavaHL bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
svnkit If set, instructs the use of SVNKit bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
failonerror Controls whether an error stops the build or is merely reported to the screen. No (defaults to "true")

Nested Types

No nested types defined for this type.

Description

This file selector is used to discriminate files within a fileset based on a Subversion status. In particular, this selector keeps files that are recognized as 'conflicted'.

When updating a subversion item (file or directory), it is possible to have two sets of changes merged into the working item. This happens when the item was modified locally as well as remotely during the period since the last update. If the two sets of changes conflict (same lines of a file changes, same directory entries modified), then the item is marked as 'conflicted'. In general, svn status displays 'conflicted' items with the letter C preceeding the name. Note that 'conflicted' items are also considered 'modified'.

Example: to copy a number of files with the status 'conflicted' from their location in workingcopy to a new directory called test, the following ant task can be used:


<copy todir="test">
	<fileset dir="workingcopy">
		<svnConflicted/>
	</fileset>
</copy>
		
				

svnIgnored

File selector that performs discrimination based on the 'ignored' subversion status.

Implementation: org.tigris.subclipse.svnant.selectors.Ignored

Parameters

Attribute Description Required
javahl If set, instructs the use of JavaHL bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
svnkit If set, instructs the use of SVNKit bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
failonerror Controls whether an error stops the build or is merely reported to the screen. No (defaults to "true")

Nested Types

No nested types defined for this type.

Description

This file selector is used to discriminate files within a fileset based on a Subversion status. In particular, this selector keeps files that are recognized as 'ignored'.

An 'ignored' file or directory is one which name match the patterns found in the parent directory's svn:ignore property. In general, svn status --no-ignore display those items with the letter I preceeding the name.

Example: to copy a number of files with the status 'ignored' from their location in workingcopy to a new directory called test, the following ant task can be used:


<copy todir="test">
	<fileset dir="workingcopy">
		<svnIgnored/>
	</fileset>
</copy>
		
				

svnLocked

File selector that performs discrimination based on the 'locked' subversion status.

Implementation: org.tigris.subclipse.svnant.selectors.Locked

Parameters

Attribute Description Required
javahl If set, instructs the use of JavaHL bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
svnkit If set, instructs the use of SVNKit bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
failonerror Controls whether an error stops the build or is merely reported to the screen. No (defaults to "true")

Nested Types

No nested types defined for this type.

Description

This file selector is used to discriminate files within a fileset based on a Subversion status. In particular, this selector keeps files that are recognized as 'locked'.

A 'locked' file or directory is one where the repository has been informed of the intent of a user to prevent others from modifying the file. For a working copy to be aware of this fact, it must have been 'updated' since the lock status was changed. In general, svn status displays those items with one of the letters K, O or B in the sixth column. The 'lock' status is independent of most other conditions such as 'modified', 'conflicted', etc.

Example: to copy a number of files with the status 'locked' from their location in workingcopy to a new directory called test, the following ant task can be used:


<copy todir="test">
	<fileset dir="workingcopy">
		<svnLocked/>
	</fileset>
</copy>
		
				

svnNormal

File selector that performs discrimination based on the 'normal' subversion status.

Implementation: org.tigris.subclipse.svnant.selectors.Normal

Parameters

Attribute Description Required
javahl If set, instructs the use of JavaHL bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
svnkit If set, instructs the use of SVNKit bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
failonerror Controls whether an error stops the build or is merely reported to the screen. No (defaults to "true")

Nested Types

No nested types defined for this type.

Description

This file selector is used to discriminate files within a fileset based on a Subversion status. In particular, this selector keeps files that are recognized as 'normal'.

A 'normal' file or directory is one that has not undergone any changes since the last update. In general, this is the great majority of the files in a working copy. svn status returns no special character for those items (a space in the first column).

Example: to copy a number of files with the status 'normal' from their location in workingcopy to a new directory called test, the following ant task can be used:


<copy todir="test">
	<fileset dir="workingcopy">
		<svnNormal/>
	</fileset>
</copy>
		
				

svnReplaced

File selector that performs discrimination based on the 'replaced' subversion status.

Implementation: org.tigris.subclipse.svnant.selectors.Replaced

Parameters

Attribute Description Required
javahl If set, instructs the use of JavaHL bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
svnkit If set, instructs the use of SVNKit bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
failonerror Controls whether an error stops the build or is merely reported to the screen. No (defaults to "true")

Nested Types

No nested types defined for this type.

Description

This file selector is used to discriminate files within a fileset based on a Subversion status. In particular, this selector keeps files that are recognized as 'replaced'.

A 'replaced' file or directory is one that has been deleted, then created anew and finally added back to the repository. Also, those changes must not have been comitted. In general, svn status displays those items with the letter R preceeding the name.

Example: to copy a number of files with the status 'replaced' from their location in workingcopy to a new directory called test, the following ant task can be used:


<copy todir="test">
	<fileset dir="workingcopy">
		<svnReplaced/>
	</fileset>
</copy>
		
				

svnMissing

File selector that performs discrimination based on the 'missing' subversion status.

Implementation: org.tigris.subclipse.svnant.selectors.Missing

Parameters

Attribute Description Required
javahl If set, instructs the use of JavaHL bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
svnkit If set, instructs the use of SVNKit bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
failonerror Controls whether an error stops the build or is merely reported to the screen. No (defaults to "true")

Nested Types

No nested types defined for this type.

Description

This file selector is used to discriminate files within a fileset based on a Subversion status. In particular, this selector keeps files that are recognized as 'missing'.

A 'missing' file or directory is one that is managed by Subversion and has been deleted without using the remove command. In general, svn status displays those items with the exclamation point (!) preceeding the name.

It is important to note that a regular FileSet (the one supplied by ANT) can not detect a missing item, since it does not exist on the file system. To detect Subversion missing items, use the FileSet provided by svn-ant (svnFileSet).

Example: to delete missing files from the repository associated with a workingcopy:


<svn>
	<delete>
		<svnFileSet dir="workingcopy">
			<svnMissing/>
		</svnFileSet>
	</delete>
</svn>
		
				

svnDeleted

File selector that performs discrimination based on the 'deleted' subversion status.

Implementation: org.tigris.subclipse.svnant.selectors.Deleted

Parameters

Attribute Description Required
javahl If set, instructs the use of JavaHL bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
svnkit If set, instructs the use of SVNKit bindings, if available. Set to false to use command line client interface to subversion. Defaults to true. See note for more details. No
failonerror Controls whether an error stops the build or is merely reported to the screen. No (defaults to "true")

Nested Types

No nested types defined for this type.

Description

This file selector is used to discriminate files within a fileset based on a Subversion status. In particular, this selector keeps files that are recognized as 'deleted'.

A 'deleted' file or directory is one that has been erased using Subversion's 'remove' command. In general, svn status displays those items with the letter D preceeding the name.

It is important to note that a regular FileSet (the one supplied by ANT) can not detect a deleted item, since it does not exist on the file system. To detect Subversion deleted items, use the FileSet provided by svn-ant (svnFileSet).

Example: to revert deleted files from a workingcopy:


<svn>
	<revert>
		<svnFileSet dir="workingcopy">
			<svnDeleted/>
		</svnFileSet>
	</revert>
</svn>