This class provides methods which allow to check out, update, switch and relocate a
Working Copy as well as export an unversioned directory or file from a repository.
Here's a list of the
SVNUpdateClient's methods
matched against corresponing commands of the SVN command line
client:
| SVNKit | Subversion |
| doCheckout() | 'svn checkout' |
| doUpdate() | 'svn update' |
| doSwitch() | 'svn switch' |
| doRelocate() | 'svn switch --relocate oldURL newURL' |
| doExport() | 'svn export' |
doCanonicalizeURLs
public void doCanonicalizeURLs(File dst,
boolean omitDefaultPort,
boolean recursive)
throws SVNException Canonicalizes all urls in the specified Working Copy.
dst - a WC pathomitDefaultPort - if true then removes all
port numbers from urls which equal to default ones, otherwise
does notrecursive - recurses an operation
doCheckout
public long doCheckout(SVNURL url,
File dstPath,
SVNRevision pegRevision,
SVNRevision revision,
boolean recursive)
throws SVNException Checks out a Working Copy from a repository.
If the destination path (
dstPath) is
null
then the last component of
url is used for the local directory name.
As a revision
SVNRevision's pre-defined constant fields can be used. For example,
to check out a Working Copy at the latest revision of the repository use
HEAD.
url - a repository location from where a Working Copy will be checked outdstPath - the local path where the Working Copy will be placedpegRevision - the revision at which url will be firstly seen
in the repository to make sure it's the one that is neededrevision - the desired revision of the Working Copy to be checked outrecursive - if true and url is
a directory then the entire tree will be checked out, otherwise if
false - only items located immediately
in the directory itself
- the revision number of the Working Copy
SVNException - url refers to a file, not a directory; dstPath
already exists but it is a file, not a directory; dstPath already
exists and is a versioned directory but has a different URL (repository location
against which the directory is controlled)
doExport
public long doExport(File srcPath,
File dstPath,
SVNRevision pegRevision,
SVNRevision revision,
String eolStyle,
boolean force,
boolean recursive)
throws SVNException Exports a clean directory or single file from eihter a source Working Copy or
a repository.
How this method works:
- If
revision is different from BASE,
WORKING, COMMITTED,
UNDEFINED - then the repository origin of srcPath
will be exported (what is done by "remote" doExport()).
- In other cases a clean unversioned copy of
srcPath - either a directory or a single file -
is exported to dstPath.
If
eolStyle is not
null then it should denote
a specific End-Of-Line marker for the files to be exported. Significant values for
eolStyle are:
- "CRLF" (Carriage Return Line Feed) - this causes files to contain '\r\n' line ending sequences
for EOL markers, regardless of the operating system in use (for instance, this EOL marker is used by
software on the Windows platform).
- "LF" (Line Feed) - this causes files to contain '\n' line ending sequences
for EOL markers, regardless of the operating system in use (for instance, this EOL marker is used by
software on the Unix platform).
- "CR" (Carriage Return) - this causes files to contain '\r' line ending sequences
for EOL markers, regardless of the operating system in use (for instance, this EOL marker was used by
software on older Macintosh platforms).
- "native" - this causes files to contain the EOL markers that are native to the operating system
on which SVNKit is run.
srcPath - a repository location from where the unversioned directory/file will
be exporteddstPath - the local path where the repository items will be exported topegRevision - the revision at which url will be firstly seen
in the repository to make sure it's the one that is neededrevision - the desired revision of the directory/file to be exportedeolStyle - a string that denotes a specific End-Of-Line charecter;force - true to fore the operation even
if there are local files with the same names as those in the repository
(local ones will be replaced)recursive - if true and url is
a directory then the entire tree will be exported, otherwise if
false - only items located immediately
in the directory itself
- the revision number of the exported directory/file
doExport
public long doExport(SVNURL url,
File dstPath,
SVNRevision pegRevision,
SVNRevision revision,
String eolStyle,
boolean force,
boolean recursive)
throws SVNException Exports a clean directory or single file from a repository.
If
eolStyle is not
null then it should denote
a specific End-Of-Line marker for the files to be exported. Significant values for
eolStyle are:
- "CRLF" (Carriage Return Line Feed) - this causes files to contain '\r\n' line ending sequences
for EOL markers, regardless of the operating system in use (for instance, this EOL marker is used by
software on the Windows platform).
- "LF" (Line Feed) - this causes files to contain '\n' line ending sequences
for EOL markers, regardless of the operating system in use (for instance, this EOL marker is used by
software on the Unix platform).
- "CR" (Carriage Return) - this causes files to contain '\r' line ending sequences
for EOL markers, regardless of the operating system in use (for instance, this EOL marker was used by
software on older Macintosh platforms).
- "native" - this causes files to contain the EOL markers that are native to the operating system
on which SVNKit is run.
url - a repository location from where the unversioned directory/file will
be exporteddstPath - the local path where the repository items will be exported topegRevision - the revision at which url will be firstly seen
in the repository to make sure it's the one that is neededrevision - the desired revision of the directory/file to be exportedeolStyle - a string that denotes a specific End-Of-Line charecter;force - true to fore the operation even
if there are local files with the same names as those in the repository
(local ones will be replaced)recursive - if true and url is
a directory then the entire tree will be exported, otherwise if
false - only items located immediately
in the directory itself
- the revision number of the exported directory/file
doRelocate
public void doRelocate(File dst,
SVNURL oldURL,
SVNURL newURL,
boolean recursive)
throws SVNException Substitutes the beginning part of a Working Copy's URL with a new one.
When a repository root location or a URL schema is changed the old URL of the
Working Copy which starts with
oldURL should be substituted for a
new URL beginning -
newURL.
dst - a Working Copy item's patholdURL - the old beginning part of the repository's URL that should
be overwrittennewURL - a new beginning part for the repository location that
will overwrite oldURLrecursive - if true and dst is
a directory then the entire tree will be relocated, otherwise if
false - only dst itself
doSwitch
public long doSwitch(File file,
SVNURL url,
SVNRevision revision,
boolean recursive)
throws SVNException Updates the Working Copy item to mirror a new URL.
As a revision
SVNRevision's pre-defined constant fields can be used. For example,
to update the Working Copy to the latest revision of the repository use
HEAD.
Calling this method is equivalent to
doSwitch(file, url, SVNRevision.UNDEFINED, revision, recursive).
file - the Working copy item to be switchedurl - the repository location as a target against which the item will
be switchedrevision - the desired revision of the repository targetrecursive - if true and file is
a directory then the entire tree will be updated, otherwise if
false - only items located immediately
in the directory itself
- the revision number to which
file was updated to
doSwitch
public long doSwitch(File file,
SVNURL url,
SVNRevision pegRevision,
SVNRevision revision,
boolean recursive)
throws SVNException Updates the Working Copy item to mirror a new URL.
As a revision
SVNRevision's pre-defined constant fields can be used. For example,
to update the Working Copy to the latest revision of the repository use
HEAD.
file - the Working copy item to be switchedurl - the repository location as a target against which the item will
be switchedpegRevision - a revision in which file is first looked up
in the repositoryrevision - the desired revision of the repository targetrecursive - if true and file is
a directory then the entire tree will be updated, otherwise if
false - only items located immediately
in the directory itself
- the revision number to which
file was updated to
doUpdate
public long doUpdate(File file,
SVNRevision revision,
boolean recursive)
throws SVNException Brings the Working Copy item up-to-date with repository changes at the specified
revision.
As a revision
SVNRevision's pre-defined constant fields can be used. For example,
to update the Working Copy to the latest revision of the repository use
HEAD.
file - the Working copy item to be updatedrevision - the desired revision against which the item will be updatedrecursive - if true and file is
a directory then the entire tree will be updated, otherwise if
false - only items located immediately
in the directory itself
- the revision number to which
file was updated to