svnFileset
FileSet replacement that operates on list of files obtained from Subversion.
| Attribute | Description | Required |
| dir |
Specifies the root directory used by the file set. It should specify a directory
managed by Subversion.
| One of these |
| file |
If used, specifies a fileset that contains a single file.
|
| username |
username that will be used for all nested svn commands.
Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.
|
| password |
password that will be used for all nested svn commands.
Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.
|
| javahl |
Set to "false" to use command line client interface instead of JNI JavaHL binding.
Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.
Default: true |
| svnkit |
Set to "false" to use command line client interface instead of SVNKit binding.
Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.
Default: false |
| failonerror |
Controls whether an error stops the build or is merely reported to the screen.
Deprecated. This attribute won't work with SVNANT 1.3.2+ . Use refid for svnSetting instead.
Default: true |
| refid |
If set the configuration for this task is taken from a svnSetting object. Such a settings instance simply provides default values, so they will be overridden in case the corresponding attribute on this task has been set.
|
| includes |
Comma-seperated or space-separated list of patterns, which describe files that are
included. If this attribute if not specified, then all files are included.
| No |
| excludes |
Comma-seperated or space-separated list of patterns, which describe files that are
excluded. If this attribute if not specified, then no files are excluded.
| No |
| Nested elements |
| Element | Description |
| exclude |
The type svnFileSet can include the nested type 'exclude', similar to a classic FileSet.
|
| include |
The type svnFileSet can include the nested type 'include', similar to a classic FileSet.
|
| patternSet |
The type svnFileSet can include the nested type 'patternSet', similar to a classic FileSet.
|
| selector |
The type svnFileSet can include the any file selector, such as contains, date size, or any
file selector defined by svn-ant
|
This type implements a FileSet. Instances of FileSet are used in tasks that operates on
a number of files. The files selected by a FileSet can be tailored by a number of patterns
and selectors. More information about file sets is available with the Ant documentation.
The motivation with creating a replacement FileSet that is based on Subversion was to
have the ability of creating sets of files that include deleted and missing files. In fact,
the classic fileset operates only on files that are reported by the file system and can not
predict deleted and missing files. Furthermore, there are useful commands that can be
performed on deleted and missing files, such as 'revert', 'delete', 'update' and others.
At the present time, svnFileSet is experimental. It supports selectors but it does not
yet accept any patterns (include, exclude). Those enhancements are to come later.
svnFileSet can be used within any svn-ant task that supports a nested file sets. It
can also be used in any task that is based on a file set. If you have a problem using
svnFileSet within a task that works well with the classic fileset, then report the problem
to the author of the task. However, for the time being, there is a work around your problem.
Instead of using a svnFileSet directly in the targeted task, use it indirectly via a classic
fileset and a reference. For example, if ANT complains about a task similar to the
following:
<target name="example">
<mkdir dir="test"/>
<copy todir="test">
<svnFileSet dir="workingcopy">
<svnAdded/>
</svnFileSet>
</copy>
</target>
you can rewrite it, using a reference, as:
<target name="example">
<svnFileSet id="svnFileSetId_1" dir="workingcopy">
<svnAdded/>
</svnFileSet>
<mkdir dir="test"/>
<copy todir="test">
<fileset refid="svnFileSetId_1"/>
</copy>
</target>
If you are the author of a fileset-based task and that you can not understand why
your task does not accept svnFileSet while it works perfectly well with the classic
fileset, here is a thing you can check. If your task accepts instances of FileSet with a
method similar to:
public void addFileset(FileSet set) {
...
}
then adding the following method should fix the problem:
public void add(FileSet set) {
addFileSet(set);
}
Examples:
The following ant script can be used to remove all missing files from the associated
repository:
<svn>
<delete>
<svnFileSet dir="workingcopy">
<svnMissing/>
</svnFileSet>
</delete>
<commit
dir="workingcopy"
message="automatically removing missing files"
/>
</svn>
The following ant script can be used to add all new files to the associated repository:
<svn>
<add>
<svnFileSet dir="workingcopy">
<svnUnversioned/>
</svnFileSet>
</add>
<commit
dir="workingcopy"
message="automatically adding files"
/>
</svn>
The following ant script can be used to restore all deleted files:
<svn>
<revert>
<svnFileSet dir="workingcopy">
<svnDeleted/>
</svnFileSet>
</revert>
</svn>
If, in the previous example, you wanted svn-ant to use the command line adapter:
<svn javahl="false" svnkit="false">
<revert>
<svnFileSet
dir="workingcopy"
javahl="false"
svnkit="false"
>
<svnDeleted javahl="false" svnkit="false"/>
</svnFileSet>
</revert>
</svn>