The
SVNRepositoryReplicator class provides an ability to make a copy of an existing repository. The replicator does not create a repository for itself, so, both repositories, source and target, must already exist.
There's two general strategies for a replicator:
- Copying a range of revisions.
- Incremental copying (like the first one, but copies a special range of revisions).
If the range of revisions being copied is
[start, end]
, then the target repository's last revision must be
start - 1
. For example, when copying from the very beginning of a source repository, you pass
start = 1
, what means that the target repository's latest revision must be 0.
An incremental copying means copying from a source repository a revisions range starting at the revision equal to the target repository's latest revision + 1 (including) and up to the source repository's latest revision (also including). This allows to fill up missing revisions from the source repository in the target one, when you, say, once replicated the source repository and got some extra new revisions in it since then.
On condition that a user has got read permissions on the entire source repository and write permissions on the destination one, replicating guarantees that for each N th revision copied from the source repository the user'll have in the N th revision of the destination repository the same changes in both versioned and unversioned (revision properties) data except locks as in the source repository.
With modern Subersion servers you may alternatively use {@link SVNRepository#replay(long,long,boolean,ISVNEditor)} for repository replication purposes.
@author TMate Software Ltd.
@version 1.3
@since 1.2