Export files and directories from a Subversion repository.
Task package: | org.tmatesoft.svn |
Java package: | org.schmant.task.svnkit |
Category: | SCM tasks |
Since: | 0.7 |
EntityFS-aware? | Yes* |
Description:
Export files and directories from a Subversion repository.
This task does not export any Subversion
metadata (.svn
directories), just the contents of the repository.
This corresponds to the svn export
command.
The task uses the SVNKit client library for Subversion access. Subversion concepts are explained in the Subversion book.
SVNKit uses an authentication manager with an
authentication provider for authenticating against a Subversion repository.
The default authentication manager and provider use the credentials that are
stored for the user running the script (in the ~/.svn
directory on
Unix).
The script can use another authentication manager by setting the
authenticationManager
property. The default
authentication manager can be used with a custom authentication provider by
setting the authenticationProvider
property. Schmant
comes with two custom authentication provider implementations:
- PromptingAuthenticationProvider – prompt for user name and password on the script console if required. This requires that the script has an attached console, i.e. that it is run interactively (see Console).
- UsernamePasswordAuthenticationProvider – use a username and password hard-coded in the script.
Required properties
Properties
authenticationManager | top |
Use this property to set a custom
ISVNAutenticationManager to use for authentication
against the Subversion server. If this is set, any
authenticationProvider
set will not be used.
Often it suffices to just set an
authenticationProvider
.
- Setter method:
setAuthenticationManager(ISVNAuthenticationManager m)
parameters:m
– Authentication manager.- See also:
- authenticationProvider
authenticationProvider | top |
An ISVNAuthenticationProvider to use for collecting user credentials when the Subversion server prompts for them.
Two implementations are:
- PromptingAuthenticationProvider – prompt for username and password
- UsernamePasswordAuthenticationProvider – use a preconfigured username and password pair.
If this is not set, the default authentication provider is used. It uses
the credentials already stored in the local Subversion configuration directory
for the user running the script. (~/.subversion
on Unix.) If it
does not have the requested credentials, the task fails.
If a custom authenticationManager
is
set, this property is not used.
- Setter method:
setAuthenticationProvider(ISVNAuthenticationProvider p)
parameters:p
– An authentication provider.- See also:
- authenticationManager
logFooter | top |
The message that is logged to info
level
after the task has been successfully run.
- Setter method:
setLogFooter(String s)
parameters:s
– The footer message.- Default value:
- Empty (no footer message is logged.)
- See also:
- logHeader
logHeader | top |
The message that is logged to info
level
before the task is run.
- Setter method:
setLogHeader(String s)
parameters:s
– The header message.- Default value:
- A task class specific message.
- See also:
- logFooter
overwriteStrategy | top |
The overwrite strategy decides how the task will react if there already is an entity (file or directory) in a location where it wants to create a new entity.
If the strategy is to not overwrite existing entities, the task will fail when it cannot create the entities that it wants to create.
Non-empty directories are never overwritten, regardless of the chosen strategy.
- Setter method:
setOverwrite(boolean b)
Setting this to a value ofparameters:true
means that the DoOverwriteAndLogWarning strategy is used. A value of false gives the DontOverwriteAndThrowException strategy.b
– Should an existing entity be overwritten?- Setter method:
setOverwriteStrategy(OverwriteStrategy strat)
Set the overwrite strategy.parameters:strat
– The overwrite strategy.- Default value:
- DontOverwriteAndThrowException
- See also:
- target
recursive | top |
Should the contents of the repository be exported recursively? If not and the repository URL points to a directory, only the immediate contents of that directory will be exported.
- Setter method:
setRecursive(boolean b)
parameters:b
– Recursive?- Default value:
true
reportLevel | top |
This property is used to change the Report level for all task created by this task factory. The report level is changed for the thread running the task when the it is run, and is restored to its previous level when the it is done.
- Setter method:
setReportLevel(Level l)
Set the report levelparameters:l
– The new report level.
repositoryLocation (required) | top |
The location of the Subversion repository. The task
supports file://
, svn[+xxx]://
and
http[s]://
URL:s.
- Setter method:
setRepositoryLocation(String s)
parameters:- Setter method:
setRepositoryLocation(SVNURL l)
parameters:l
– The repository location.
revision | top |
The revision number of the contents to export. Set to
-1
to export the latest revision.
- Setter method:
setRevision(long no)
Set the revision number.parameters:no
– Revision number.- Default value:
-1
, i.e. the latest revision.
target (required) | top |
Target directory for the export.
- Setter method:
setTarget(Object o)
parameters:- See also:
- overwriteStrategy
traceLogging | top |
If trace logging is enabled for a task, it reports its configuration before it is run.
Trace logging may also be enabled globally for all tasks by calling TraceMode.setTraceMode(boolean).
- Setter method:
setTraceLogging(boolean b)
Enable or disable trace logging.parameters:b
– Enable trace logging?
Examples
Example 1
Export the contents of the latest revision of a Subversion reposotory to a temporary directory.
JavaScript
JRuby
Jython
* An EntityFS-aware task is implemented using EntityFS. This means that it uses the filter settings of DirectoryView:s and also that it often can work with other file system implementations than File-based, such as the RAM file system.