Copy contents within a Subversion repository.
Task package: | org.tmatesoft.svn |
Java package: | org.schmant.task.svnkit |
Category: | SCM tasks |
Since: | 0.7 |
EntityFS-aware? | Yes* |
Description:
Copy contents within a Subversion repository. This corresponds to the
svn copy
command and it can be used for tagging and branching
repositories.
This task uses the SVNKit client library for Subversion access. Subversion concepts are explained in the Subversion book.
Note: Since SVNKit 1.3.2 (from Schmant 1.1), copying between two different repositories seems to work under some circumstances. Use with caution.
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
pegRevision | top |
The peg revision to copy. What the peg revision is is explained in the Subversion book.
- Setter method:
setPegRevision(long no)
Set the peg revision number.parameters:no
– Peg revision number.- Setter method:
setPegRevision(SVNRevision r)
Set the peg revision.parameters:r
– Revision.- Default value:
UNDEFINED
, which means that the revision will be used for peg revision.- See also:
- revision
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 source that should be copied. Set to
-1
to copy the latest revision.
- Setter method:
setRevision(long no)
Set the revision number.parameters:no
– Revision number.- Setter method:
setRevision(SVNRevision r)
Set the revision.parameters:r
– Revision.- Default value:
-1
(the latest revision).- See also:
- pegRevision
svnOptions | top |
Various Subversion client options. See SVNKit documentation for more information.
- Setter method:
setSvnOptions(ISVNOptions o)
parameters:o
– Subversion client options.- Default value:
- Default options.
targetRepositoryLocation (required) | top |
The target location of the contents to copy. This must be in the same repository as the source location.
- Setter method:
setTargetRepositoryLocation(String s)
parameters:- Setter method:
setTargetRepositoryLocation(SVNURL l)
parameters:l
– The target repository location.- See also:
- repositoryLocation
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
Copy the contents of the latest revision of the
trunk
catalog to the tags/1.0
catalog in the
Subversion repository.
JavaScript
* 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.