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. |
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"/>
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:
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:
File selector that performs discrimination based on the 'added' subversion status.
Implementation: | org.tigris.subclipse.svnant.selectors.Added |
---|
Attribute | Description | Required |
---|---|---|
javahl |
|
|
svnkit |
|
|
failonerror |
|
|
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>
File selector that performs discrimination based on the 'modified' subversion status.
Implementation: | org.tigris.subclipse.svnant.selectors.Modified |
---|
Attribute | Description | Required |
---|---|---|
javahl |
|
|
svnkit |
|
|
failonerror |
|
|
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>
File selector that performs discrimination based on the 'unversioned' subversion status.
Implementation: | org.tigris.subclipse.svnant.selectors.Unversioned |
---|
Attribute | Description | Required |
---|---|---|
javahl |
|
|
svnkit |
|
|
failonerror |
|
|
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>
File selector that performs discrimination based on the 'conflicted' subversion status.
Implementation: | org.tigris.subclipse.svnant.selectors.Conflicted |
---|
Attribute | Description | Required |
---|---|---|
javahl |
|
|
svnkit |
|
|
failonerror |
|
|
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>
File selector that performs discrimination based on the 'ignored' subversion status.
Implementation: | org.tigris.subclipse.svnant.selectors.Ignored |
---|
Attribute | Description | Required |
---|---|---|
javahl |
|
|
svnkit |
|
|
failonerror |
|
|
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>
File selector that performs discrimination based on the 'locked' subversion status.
Implementation: | org.tigris.subclipse.svnant.selectors.Locked |
---|
Attribute | Description | Required |
---|---|---|
javahl |
|
|
svnkit |
|
|
failonerror |
|
|
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>
File selector that performs discrimination based on the 'normal' subversion status.
Implementation: | org.tigris.subclipse.svnant.selectors.Normal |
---|
Attribute | Description | Required |
---|---|---|
javahl |
|
|
svnkit |
|
|
failonerror |
|
|
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>
File selector that performs discrimination based on the 'replaced' subversion status.
Implementation: | org.tigris.subclipse.svnant.selectors.Replaced |
---|
Attribute | Description | Required |
---|---|---|
javahl |
|
|
svnkit |
|
|
failonerror |
|
|
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>
File selector that performs discrimination based on the 'missing' subversion status.
Implementation: | org.tigris.subclipse.svnant.selectors.Missing |
---|
Attribute | Description | Required |
---|---|---|
javahl |
|
|
svnkit |
|
|
failonerror |
|
|
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>
File selector that performs discrimination based on the 'deleted' subversion status.
Implementation: | org.tigris.subclipse.svnant.selectors.Deleted |
---|
Attribute | Description | Required |
---|---|---|
javahl |
|
|
svnkit |
|
|
failonerror |
|
|
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>