public class SVNRepositoryImpl extends SVNRepository implements ISVNReporter
INVALID_REVISION, myLocation, myRepositoryRoot, myRepositoryUUID
Modifier | Constructor and Description |
---|---|
protected |
SVNRepositoryImpl(SVNURL location,
ISVNSession options) |
Modifier and Type | Method and Description |
---|---|
void |
abortReport()
Aborts the current running report due to errors occured.
|
SVNNodeKind |
checkPath(java.lang.String path,
long revision)
Returns the kind of an item located at the specified path in
a particular revision.
|
protected void |
closeConnection() |
void |
closeSession()
Closes the current session closing a socket connection used by
this object.
|
void |
deletePath(java.lang.String path)
Describes a working copy
path as deleted or missing. |
void |
diff(SVNURL url,
long targetRevision,
long revision,
java.lang.String target,
boolean ignoreAncestry,
SVNDepth depth,
boolean getContents,
ISVNReporterBaton reporter,
ISVNEditor editor)
Asks this repository access object to 'diff' a working copy against
targetRevision . |
void |
finishReport()
Finalizes the report.
|
ISVNEditor |
getCommitEditor(java.lang.String logMessage,
java.util.Map locks,
boolean keepLocks,
ISVNWorkspaceMediator mediator)
Gets an editor for committing changes to a repository.
|
protected ISVNEditor |
getCommitEditorInternal(java.util.Map locks,
boolean keepLocks,
SVNProperties revProps,
ISVNWorkspaceMediator mediator) |
long |
getDatedRevision(java.util.Date date)
Returns the recent repository revision number for the particular moment
in time - the closest one before or at the specified datestamp.
|
protected long |
getDeletedRevisionImpl(java.lang.String path,
long pegRevision,
long endRevision) |
SVNDirEntry |
getDir(java.lang.String path,
long revision,
boolean includeComment,
java.util.Collection entries)
Fetches the contents of a directory into the provided
collection object and returns the directory entry itself.
|
long |
getDir(java.lang.String path,
long revision,
SVNProperties properties,
int entryFields,
ISVNDirEntryHandler handler)
Fetches the contents and/or properties of a directory located at the specified path
in a particular revision with the possibility to specify fields of the entry to fetch.
|
long |
getDir(java.lang.String path,
long revision,
SVNProperties properties,
ISVNDirEntryHandler handler)
Fetches the contents and/or properties of a directory located at the specified path
in a particular revision.
|
java.lang.String |
getExternalUserName() |
long |
getFile(java.lang.String path,
long revision,
SVNProperties properties,
java.io.OutputStream contents)
Fetches the contents and/or properties of a file located at the specified path
in a particular revision.
|
protected int |
getFileRevisionsImpl(java.lang.String path,
long startRevision,
long endRevision,
boolean includeMergedRevisions,
ISVNFileRevisionHandler handler) |
protected void |
getInheritedPropertiesImpl(java.lang.String path,
long revision,
java.lang.String propertyName,
ISVNInheritedPropertiesHandler handler) |
long |
getLatestRevision()
Returns the number of the latest revision of the repository this
driver is working with.
|
protected long |
getLocationSegmentsImpl(java.lang.String path,
long pegRevision,
long startRevision,
long endRevision,
ISVNLocationSegmentHandler handler) |
protected int |
getLocationsImpl(java.lang.String path,
long pegRevision,
long[] revisions,
ISVNLocationEntryHandler handler) |
SVNLock |
getLock(java.lang.String path)
Gets the lock for the file located at the specified path.
|
SVNLock[] |
getLocks(java.lang.String path)
Gets all locks on or below the
path , that is if the repository
entry (located at the path ) is a directory then the method
returns locks of all locked files (if any) in it. |
protected java.util.Map |
getMergeInfoImpl(java.lang.String[] paths,
long revision,
SVNMergeInfoInheritance inherit,
boolean includeDescendants) |
java.lang.String |
getRealm() |
SVNProperties |
getRevisionProperties(long revision,
SVNProperties properties)
Returns unversioned revision properties for a particular revision.
|
SVNPropertyValue |
getRevisionPropertyValue(long revision,
java.lang.String propertyName)
Gets the value of an unversioned property.
|
boolean |
hasCapability(SVNCapability capability)
Returns
true if the repository has specified capability . |
SVNDirEntry |
info(java.lang.String path,
long revision)
Gives information about an entry located at the specified path in a particular
revision.
|
void |
linkPath(SVNURL url,
java.lang.String path,
java.lang.String lockToken,
long revision,
boolean startEmpty)
Describes a local path as being at a particular revision
to switch the path to a different repository location.
|
void |
linkPath(SVNURL url,
java.lang.String path,
java.lang.String lockToken,
long revision,
SVNDepth depth,
boolean startEmpty)
Describes a local path as being at a particular revision
to switch the path to a different repository location.
|
void |
lock(java.util.Map pathsToRevisions,
java.lang.String comment,
boolean force,
ISVNLockHandler handler)
Locks path(s) at definite revision(s).
|
protected long |
logImpl(java.lang.String[] targetPaths,
long startRevision,
long endRevision,
boolean changedPaths,
boolean strictNode,
long limit,
boolean includeMergedRevisions,
java.lang.String[] revisionPropertyNames,
ISVNLogEntryHandler handler) |
protected void |
openConnection() |
void |
replay(long lowRevision,
long highRevision,
boolean sendDeltas,
ISVNEditor editor)
Replays the changes from the specified revision through the given editor.
|
protected void |
replayRangeImpl(long startRevision,
long endRevision,
long lowRevision,
boolean sendDeltas,
ISVNReplayHandler handler) |
void |
setExternalUserName(java.lang.String userName) |
void |
setLocation(SVNURL url,
boolean forceReconnect)
Sets a new repository location for this object.
|
void |
setPath(java.lang.String path,
java.lang.String lockToken,
long revision,
boolean startEmpty)
Describes a local path as being at a particular revision.
|
void |
setPath(java.lang.String path,
java.lang.String lockToken,
long revision,
SVNDepth depth,
boolean startEmpty)
Describes a working copy
path as being at a particular
revision and having depth depth . |
void |
setRevisionPropertyValue(long revision,
java.lang.String propertyName,
SVNPropertyValue propertyValue)
Sets a revision property with the specified name to a new value.
|
void |
status(long revision,
java.lang.String target,
SVNDepth depth,
ISVNReporterBaton reporter,
ISVNEditor editor)
Gets status of a path to the particular
depth as a scope. |
void |
testConnection()
Tries to access a repository.
|
void |
unlock(java.util.Map pathToTokens,
boolean force,
ISVNLockHandler handler)
Removes lock(s) from the file(s).
|
void |
update(long revision,
java.lang.String target,
SVNDepth depth,
boolean sendCopyFromArgs,
ISVNReporterBaton reporter,
ISVNEditor editor)
Updates a path receiving changes from a repository.
|
void |
update(SVNURL url,
long revision,
java.lang.String target,
SVNDepth depth,
ISVNReporterBaton reporter,
ISVNEditor editor)
Asks this repository access object to 'switch' a versioned tree to a new
url . |
addConnectionListener, assertServerIsMergeInfoCapable, assertValidRevision, checkout, checkout, checkoutFiles, diff, diff, diff, fireConnectionClosed, fireConnectionOpened, getAuthenticationManager, getCanceller, getCommitEditor, getCommitEditor, getDebugLog, getDeletedRevision, getDir, getDir, getFileRevisions, getFileRevisions, getFileRevisions, getFullPath, getInheritedProperties, getInheritedProperties, getLocation, getLocationRelativePath, getLocations, getLocations, getLocations, getLocationSegments, getLocationSegments, getMergeInfo, getOptions, getRepositoryPath, getRepositoryRoot, getRepositoryRoot, getRepositoryUUID, getRepositoryUUID, getRevisionObject, getTunnelProvider, isInvalidRevision, isValidRevision, lock, lock, log, log, log, log, removeConnectionListener, replayRange, setAuthenticationManager, setCanceller, setDebugLog, setRepositoryCredentials, setTunnelProvider, status, unlock, update, update
protected SVNRepositoryImpl(SVNURL location, ISVNSession options)
public void testConnection() throws SVNException
SVNRepository
testConnection
in class SVNRepository
SVNException
- if a failure occured while connecting to a repository
or the user's authentication failed (see
SVNAuthenticationException
)public void setLocation(SVNURL url, boolean forceReconnect) throws SVNException
SVNRepository
But you can not specify a new repository location url with a protocol different from the one used for the previous (essentially, the current) repository location, since SVNRepository objects are protocol dependent.
If a new url
is located within the same repository, this object
just switches to that url
not closing the current session (i.e.
not calling SVNRepository.closeSession()
).
If either a new url
refers to the same host (including a port
number), or refers to an absolutely different host, or this object has got
no repository root location cached (hasn't ever accessed a repository yet),
or forceReconnect
is true, then
the current session is closed, cached repository credentials (UUID and repository
root directory location ) are reset and this object is switched to a new
repository location.
setLocation
in class SVNRepository
url
- a new repository location urlforceReconnect
- if true then
forces to close the current session, resets the
cached repository credentials and switches this object to
a new location (doesn't matter whether it's on the same
host or not)SVNException
- if the old url and a new one has got different
protocolspublic long getLatestRevision() throws SVNException
SVNRepository
getLatestRevision
in class SVNRepository
SVNException
- if a failure occured while connecting to a repository
or the user's authentication failed (see
SVNAuthenticationException
)public long getDatedRevision(java.util.Date date) throws SVNException
SVNRepository
Example: if you specify a single date without specifying a time of the day (e.g. 2002-11-27) the timestamp is assumed to 00:00:00 and the method won't return any revisions for the day you have specified but for the day just before it.
getDatedRevision
in class SVNRepository
date
- a datestamp for defining the needed
moment in timeSVNException
- if a failure occured while connecting to a repository
or the user's authentication failed (see
SVNAuthenticationException
)public SVNProperties getRevisionProperties(long revision, SVNProperties properties) throws SVNException
SVNRepository
getRevisionProperties
in class SVNRepository
revision
- a revision numberproperties
- if not null then
properties will be placed in this map, otherwise
a new map will be createdSVNException
- in the following cases:
revision
number is invalid
revision
at all
SVNAuthenticationException
)
SVNRevisionProperty
public SVNPropertyValue getRevisionPropertyValue(long revision, java.lang.String propertyName) throws SVNException
SVNRepository
getRevisionPropertyValue
in class SVNRepository
revision
- a revision numberpropertyName
- a property nameSVNException
- in the following cases:
revision
number is invalid or
if there's no such revision
at all.
SVNAuthenticationException
)
public SVNNodeKind checkPath(java.lang.String path, long revision) throws SVNException
SVNRepository
path
does not exist
under the specified revision
, SVNNodeKind.NONE
will be returned.
The path
arg can be both relative to the location of
this driver and absolute to the repository root (starts with "/"
).
checkPath
in class SVNRepository
path
- an item's pathrevision
- a revision numberpath
at the given
revision
SVNException
- if a failure occured while connecting to a repository
or the user's authentication failed (see
SVNAuthenticationException
)protected int getLocationsImpl(java.lang.String path, long pegRevision, long[] revisions, ISVNLocationEntryHandler handler) throws SVNException
getLocationsImpl
in class SVNRepository
SVNException
protected long getLocationSegmentsImpl(java.lang.String path, long pegRevision, long startRevision, long endRevision, ISVNLocationSegmentHandler handler) throws SVNException
getLocationSegmentsImpl
in class SVNRepository
SVNException
public long getFile(java.lang.String path, long revision, SVNProperties properties, java.io.OutputStream contents) throws SVNException
SVNRepository
If contents
arg is not null it
will be written with file contents.
If properties
arg is not null it will
receive the properties of the file. This includes all properties: not just ones
controlled by a user and stored in the repository filesystem, but also non-tweakable
ones (e.g. 'wcprops', 'entryprops', etc.). Property names (keys) are mapped to property
values.
The path
arg can be both relative to the location of
this driver and absolute to the repository root (starts with "/"
).
If revision
is invalid (negative), HEAD revision will be used.
getFile
in class SVNRepository
path
- a file pathrevision
- a file revisionproperties
- a file properties receiver mapcontents
- an output stream to write the file contents toSVNException
- in the following cases:
path
in revision
SVNAuthenticationException
)
public long getDir(java.lang.String path, long revision, SVNProperties properties, ISVNDirEntryHandler handler) throws SVNException
SVNRepository
This method is the same as SVNRepository.getDir(String, long, SVNProperties, int, ISVNDirEntryHandler)
with entryFields
parameter set to DIRENT_ALL
.
getDir
in class SVNRepository
path
- a directory pathrevision
- a directory revisionproperties
- a directory properties receiver maphandler
- a handler to process directory entriesSVNException
- in the following cases:
path
not found in the specified revision
path
is not a directory
SVNAuthenticationException
)
SVNRepository.getDir(String, long, boolean, Collection)
,
SVNRepository.getDir(String, long, SVNProperties, int, Collection)
,
SVNDirEntry
public long getDir(java.lang.String path, long revision, SVNProperties properties, int entryFields, ISVNDirEntryHandler handler) throws SVNException
SVNRepository
If handler
arg is not null it
will be dispatched information of each directory entry represented by an
SVNDirEntry object.
If properties
arg is not null it will
receive the properties of the file. This includes all properties: not just ones
controlled by a user and stored in the repository filesystem, but also non-tweakable
ones (e.g. 'wcprops', 'entryprops', etc.). Property names (keys) are mapped to property
values.
The path
arg can be both relative to the location of
this driver and absolute to the repository root (starts with "/"
).
If revision
is invalid (negative), HEAD revision will be used.
NOTE: you may not invoke operation methods of this SVNRepository
object from within the provided handler
.
getDir
in class SVNRepository
path
- a directory pathrevision
- a directory revisionproperties
- a directory properties receiver mapentryFields
- a combination of fields for the entryhandler
- a handler to process directory entriesSVNException
- in the following cases:
path
not found in the specified revision
path
is not a directory
SVNAuthenticationException
)
SVNRepository.getDir(String, long, boolean, Collection)
,
SVNRepository.getDir(String, long, SVNProperties, int, Collection)
,
SVNDirEntry
public SVNDirEntry getDir(java.lang.String path, long revision, boolean includeComment, java.util.Collection entries) throws SVNException
SVNRepository
If entries
arg is not null it
receives the directory entries. Information of each directory entry is
represented by an SVNDirEntry object.
The path
arg can be both relative to the location of
this driver and absolute to the repository root (starts with "/"
).
getDir
in class SVNRepository
path
- a directory pathrevision
- a revision numberincludeComment
- if true then
dir entries (SVNDirEntry objects) will be supplied
with commit log messages, otherwise notentries
- a collection that receives fetched dir entriesentries
SVNException
- in the following cases:
path
not found in the specified revision
path
is not a directory
SVNAuthenticationException
)
SVNRepository.getDir(String, long, SVNProperties, ISVNDirEntryHandler)
,
SVNRepository.getDir(String, long, SVNProperties, Collection)
,
SVNDirEntry
protected int getFileRevisionsImpl(java.lang.String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler) throws SVNException
getFileRevisionsImpl
in class SVNRepository
SVNException
protected long logImpl(java.lang.String[] targetPaths, long startRevision, long endRevision, boolean changedPaths, boolean strictNode, long limit, boolean includeMergedRevisions, java.lang.String[] revisionPropertyNames, ISVNLogEntryHandler handler) throws SVNException
logImpl
in class SVNRepository
SVNException
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException
SVNRepository
Changes will be limited to those that occur under a session's URL, and
the server will assume that the client has no knowledge of revisions
prior to a lowRevision
. These two limiting factors define the portion
of the tree that the server will assume the client already has knowledge of,
and thus any copies of data from outside that part of the tree will be
sent in their entirety, not as simple copies or deltas against a previous
version.
If sendDeltas
is true, the actual text
and property changes in the revision will be sent, otherwise no text deltas and
null property changes will be sent instead.
If lowRevision
is invalid, it defaults to 0.
replay
in class SVNRepository
lowRevision
- a low revision point beyond which a client has no
knowledge of paths historyhighRevision
- a revision to replaysendDeltas
- controls whether text and property changes are to be
senteditor
- a commit editor to receive changesSVNException
- in case the repository could not be connectedSVNAuthenticationException
- in case of authentication problemspublic void setRevisionPropertyValue(long revision, java.lang.String propertyName, SVNPropertyValue propertyValue) throws SVNException
SVNRepository
NOTE: revision properties are not versioned. So, the old values may be lost forever.
setRevisionPropertyValue
in class SVNRepository
revision
- the number of the revision which property is to
be changedpropertyName
- a revision property namepropertyValue
- the value of the revision propertySVNException
- in the following cases:
revision
is invalid or doesn't
exist at all
SVNAuthenticationException
)
SVNRevisionProperty
public ISVNEditor getCommitEditor(java.lang.String logMessage, java.util.Map locks, boolean keepLocks, ISVNWorkspaceMediator mediator) throws SVNException
SVNRepository
locks
is a map used to provide lock tokens on the locked paths.
Keys are locked paths in a local tree, and each value for a key is a lock
token. locks
must live during the whole commit operation.
If keepLocks
is true, then the locked
paths won't be unlocked after a successful commit. Otherwise, if
false, locks will be automatically released.
mediator
is used for temporary delta data storage allocations.
The root path of the commit is the current repository location to which this object is set.
After the commit has succeeded ISVNEditor.closeEdit()
returns an SVNCommitInfo object
that contains a new revision number, the commit date, commit author.
NOTE: you may not invoke methods of this SVNRepository object from within the returned commit editor.
getCommitEditor
in class SVNRepository
logMessage
- a commit log messagelocks
- a map containing locked paths mapped to lock
tokenskeepLocks
- true to keep
existing locks; false
to release locks after the commitmediator
- temp delta storage provider; used also to cache
wcprops while committingSVNException
- in the following cases:
SVNAuthenticationException
)
SVNRepository.getCommitEditor(String, ISVNWorkspaceMediator)
,
Using ISVNEditor in commit operationspublic SVNLock getLock(java.lang.String path) throws SVNException
SVNRepository
The path
arg can be both relative to the location of
this driver and absolute to the repository root (starts with "/"
).
getLock
in class SVNRepository
path
- a file pathSVNException
- in the following cases:
SVNAuthenticationException
)
SVNRepository.lock(Map, String, boolean, ISVNLockHandler)
,
SVNRepository.unlock(Map, boolean, ISVNLockHandler)
,
SVNRepository.getLocks(String)
,
SVNLock
public SVNLock[] getLocks(java.lang.String path) throws SVNException
SVNRepository
path
, that is if the repository
entry (located at the path
) is a directory then the method
returns locks of all locked files (if any) in it.
The path
arg can be both relative to the location of
this driver and absolute to the repository root (starts with "/"
).
getLocks
in class SVNRepository
path
- a path under which locks are to be retrievedSVNException
- in the following cases:
SVNAuthenticationException
)
SVNRepository.lock(Map, String, boolean, ISVNLockHandler)
,
SVNRepository.unlock(Map, boolean, ISVNLockHandler)
,
SVNRepository.getLock(String)
,
SVNLock
public void lock(java.util.Map pathsToRevisions, java.lang.String comment, boolean force, ISVNLockHandler handler) throws SVNException
SVNRepository
Note that locking is never anonymous, so any server implementing this function will have to "pull" a username from the client, if it hasn't done so already.
Each path to be locked is handled with the provided handler
.
If a path was successfully locked, the handler
's
handleLock()
is called that receives the path and either a lock object (representing the lock
that was set on the path) or an error exception, if locking failed for that path.
If any path is already locked by a different user and the
force
flag is false, then this call fails
with throwing an SVNException. But if force
is
true, then the existing lock(s) will be "stolen" anyway,
even if the user name does not match the current lock's owner.
Paths can be both relative to the location of this driver and absolute to
the repository root (starting with "/"
).
lock
in class SVNRepository
pathsToRevisions
- a map which keys are paths and values are
revision numbers (as Longs); paths are strings and revision
numbers are Long objectscomment
- a comment string for the lock (optional)force
- true if the file is to be
locked in any way (even if it's already locked by someone else)handler
- if not null, the lock
handler is invoked on each path to be lockedSVNException
- in the following cases:
force
is false
and a path is already locked by someone else
SVNAuthenticationException
)
SVNRepository.unlock(Map, boolean, ISVNLockHandler)
,
SVNRepository.getLocks(String)
,
SVNRepository.getLock(String)
,
SVNLock
public void unlock(java.util.Map pathToTokens, boolean force, ISVNLockHandler handler) throws SVNException
SVNRepository
Note that unlocking is never anonymous, so any server implementing this function will have to "pull" a username from the client, if it hasn't done so already.
Each path to be unlocked is handled with the provided handler
.
If a path was successfully unlocked, the handler
's
handleUnlock()
is called that receives the path and either a lock object (representing the lock
that was removed from the path) or an error exception, if unlocking failed for
that path.
If the username doesn't match the lock's owner and force
is
false, this method call fails with
throwing an SVNException. But if the force
flag is true, the lock will be "broken"
by the current user.
Also if the lock token is incorrect or null
and force
is false, the method
fails with throwing a SVNException. However, if force
is
true the lock will be removed anyway.
Paths can be both relative to the location of this driver and absolute to
the repository root (starting with "/"
).
unlock
in class SVNRepository
pathToTokens
- a map which keys are file paths and values are file lock
tokens (both keys and values are strings)force
- true to remove the
lock in any case - i.e. to "break" the lockhandler
- if not null, the lock
handler is invoked on each path to be unlockedSVNException
- in the following cases:
force
is false
and the name of the user who tries to unlock a path does not match
the lock owner
SVNAuthenticationException
)
SVNRepository.lock(Map, String, boolean, ISVNLockHandler)
,
SVNRepository.getLocks(String)
,
SVNRepository.getLock(String)
,
SVNLock
public SVNDirEntry info(java.lang.String path, long revision) throws SVNException
SVNRepository
The path
arg can be both relative to the location of
this driver and absolute to the repository root (starts with "/"
).
info
in class SVNRepository
path
- an item's pathrevision
- a revision of the entry; defaults to the latest
revision (HEAD)path
under the specified revision
SVNException
- in the following cases:
SVNAuthenticationException
)
protected void openConnection() throws SVNException
SVNException
protected void closeConnection()
public java.lang.String getRealm()
public void setPath(java.lang.String path, java.lang.String lockToken, long revision, boolean startEmpty) throws SVNException
ISVNReporter
Describes a local path as being at a particular revision.
If startEmpty
is true and the
path
is a directory, an implementor should assume the
directory has no entries or properties (used in checkouts and aborted updates).
A next call to this method will "override" any previous setPath()
calls made on parent
paths. The path
is relative to the repository location specified for an
SVNRepository driver.
setPath
in interface ISVNReporter
path
- a local item's pathlockToken
- if not null, it is a lock token
for the path
revision
- the local item's revision numberstartEmpty
- if true and if the path
is a
directory, then means there're no entries yetSVNException
- in case the repository could not be connectedpublic void deletePath(java.lang.String path) throws SVNException
ISVNReporter
path
as deleted or missing.deletePath
in interface ISVNReporter
path
- a path relative to the root of the reportSVNException
- in case the repository could not be connectedpublic void linkPath(SVNURL url, java.lang.String path, java.lang.String lockToken, long revision, boolean startEmpty) throws SVNException
ISVNReporter
setPath()
, but differs in
that the local item's path
(relative to the root
of the report driver) isn't a reflection of the path in the repository,
but is instead a reflection of a different repository path at a
revision
.
If startEmpty
is set and the path
is a directory,
the implementor should assume the directory has no entries or properties.linkPath
in interface ISVNReporter
url
- a new repository location to switch topath
- the local item's pathlockToken
- if not null, it is a lock token
for the path
revision
- the local item's revision numberstartEmpty
- if true and if the path
is a
directory, then means there're no entries yetSVNException
- in case the repository could not be connectedpublic void finishReport() throws SVNException
ISVNReporter
Any directories or files not explicitly set (described) are assumed to be at the baseline revision.
finishReport
in interface ISVNReporter
SVNException
- in case the repository could not be connectedpublic void abortReport() throws SVNException
ISVNReporter
If an error occurs during a report, call this method to abort the reporter correctly.
abortReport
in interface ISVNReporter
SVNException
- in case the repository could not be connectedpublic void setExternalUserName(java.lang.String userName)
public java.lang.String getExternalUserName()
public void closeSession()
SVNRepository
closeSession
in class SVNRepository
public void linkPath(SVNURL url, java.lang.String path, java.lang.String lockToken, long revision, SVNDepth depth, boolean startEmpty) throws SVNException
ISVNReporter
ISVNReporter.setPath(String, String, long, SVNDepth, boolean)
, but differs in
that the local item's path
(relative to the root
of the report driver) isn't a reflection of the path in the repository,
but is instead a reflection of a different repository url
at
revision
, and has depth depth
.
path
may not be underneath a path on which ISVNReporter.setPath(String, String, long, SVNDepth, boolean)
was previously called with SVNDepth.EXCLUDE
in this report.
If startEmpty
is set and path
is a directory, that will mean that
the directory has no entries or props.
If lockToken
is non-null, it is the lock token for
path
in the local tree.linkPath
in interface ISVNReporter
url
- a new repository location to switch topath
- the local item's pathlockToken
- if not null, it is a lock token
for the path
revision
- the local item's revision numberdepth
- depth of path
startEmpty
- if true and if the path
is a
directory, then means there're no entries yetSVNException
- in case the repository could not be connectedpublic void setPath(java.lang.String path, java.lang.String lockToken, long revision, SVNDepth depth, boolean startEmpty) throws SVNException
ISVNReporter
path
as being at a particular
revision
and having depth depth
.
revision
may be invalid (<0
) if (for example) path
represents a locally-added path with no revision number, or depth
is SVNDepth.EXCLUDE
.
path
may not be underneath a path on which setPath()
was
previously called with SVNDepth.EXCLUDE
in this report.
If startEmpty
is set and path
is a directory, this will mean that
the directory has no entries or properties.
This will *override* any previous setPath()
calls made on parent
paths.
path
is relative to the location
of the repository access
object.
If lockToken
is non-null, it is the lock token for
path
in the local tree.setPath
in interface ISVNReporter
path
- a local item's pathlockToken
- if not null, it is a lock token
for the path
revision
- the local item's revision numberdepth
- depth of path
startEmpty
- if true and if the path
is a
directory, then means there're no entries yetSVNException
- in case the repository could not be connectedpublic void diff(SVNURL url, long targetRevision, long revision, java.lang.String target, boolean ignoreAncestry, SVNDepth depth, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException
SVNRepository
targetRevision
.
Note: this method cannot be used to diff a single file, only a directory.
See the SVNRepository.update(SVNURL, long, String, SVNDepth, ISVNReporterBaton, ISVNEditor)
method for more
details.
The client initially provides an editor
; this editor contains knowledge of where the common
diff root is in the working copy (when ISVNEditor.openRoot(long)
is called).
In return, the client receives a ISVNReporter
object in his ISVNReporterBaton
implementation. The client then describes its working copy by making calls into the reporter object.
When finished, the client calls ISVNReporter.finishReport()
. This SVNRepository
object then does a complete drive of editor
, ending with ISVNEditor.closeEdit()
, to
transmit the diff.
target
is an optional single path component that will restrict the scope of things affected
by the switch to an entry in the directory represented by the location
of this
object, or null if the entire directory is meant to be switched.
The working copy will be diffed against url
as it exists in revision
targeRevision
, or as it is in HEAD if targetRevision
is invalid (<0
).
Use ignoreAncestry
to control whether or not items being diffed will be checked for
relatedness first. Unrelated items are typically transmitted to the editor as a deletion of one thing
and the addition of another, but if this flag is true,
unrelated items will be diffed as if they were related.
Diffs only as deeply as depth
indicates.
The caller may not perform any repository access operations using this SVNRepository
object
before finishing the report, and may not perform any repository access operations using this
SVNRepository
object from within the editing operations of editor
.
getContents
instructs the driver of the editor
to enable the generation of
text deltas. If getContents
is false the editor
's
ISVNDeltaConsumer.textDeltaChunk(String, SVNDiffWindow)
method will be called once with
SVNDiffWindow.EMPTY
.
Note: the reporter provided by this function does NOT supply copy-from information to the diff editor
callbacks.
Note: in order to prevent pre-1.5 servers from doing more work than needed, and sending too much data
back, a pre-1.5 'recurse' directive may be sent to the server, based on depth
.diff
in class SVNRepository
url
- a repository location of the entry against which
differences are calculatedtargetRevision
- a revision number of the entry located at the
specified url
; defaults to the
latest revision (HEAD) if this arg is invalidrevision
- a revision number of the repository location to which
this driver object is settarget
- a target entry name (optional)ignoreAncestry
- if true then
the ancestry of the two entries to be diffed is
ignored, otherwise notdepth
- tree depth to processgetContents
- if false contents (diff windows) will not be sent to
the editorreporter
- a caller's reportereditor
- a caller's editorSVNException
- in the following cases:
url
not found neither in the specified
revision
nor in the HEAD revision
SVNAuthenticationException
)
public void status(long revision, java.lang.String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException
SVNRepository
depth
as a scope.
SVNRepository.status(long, String, boolean, ISVNReporterBaton, ISVNEditor)
status
in class SVNRepository
revision
- a desired revision to get status against; defaults to
the latest revision (HEAD)target
- an entry name (optional)depth
- defines the status scopereporter
- a client's reporter-batoneditor
- a client's status editorSVNException
- in the following cases:
SVNAuthenticationException
)
SVNRepository.status(long, String, boolean, ISVNReporterBaton, ISVNEditor)
,
ISVNReporterBaton
,
ISVNEditor
public void update(SVNURL url, long revision, java.lang.String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException
SVNRepository
url
.
The client initially provides an editor
; this editor contains knowledge of where the
change will begin in the working copy (ISVNEditor.openRoot(long)
is called).
In return, the client receives a ISVNReporter
object in his ISVNReporterBaton
implementation. The client then describes its working copy by making calls into the reporter object.
When finished, the client calls ISVNReporter.finishReport()
. This SVNRepository
object then does a complete drive of editor
, ending with ISVNEditor.closeEdit()
, to
switch the working copy.
target
is an optional single path component that will restrict the scope of things affected
by the switch to an entry in the directory represented by the location
of this
object, or null if the entire directory is meant to be switched.
Switches the target only as deeply as depth
indicates.
The local tree will be switched to revision
, or the HEAD revision if this arg is
invalid.
The caller may not perform any repository access operations using this SVNRepository
object
before finishing the report, and may not perform any repository access operations using this
SVNRepository
object from within the editing operations of editor
.
Note: the reporter provided by this function does NOT supply copy-from information to the diff editor
callbacks.
Note: in order to prevent pre-1.5 servers from doing more work than needed, and sending too much data
back, a pre-1.5 'recurse' directive may be sent to the server, based on depth
.update
in class SVNRepository
url
- a new location in the repository to switch torevision
- a desired revision to make update to; defaults
to the latest revision (HEAD)target
- an entry name (optional)depth
- the depth for update operationreporter
- a caller's reportereditor
- a caller's editorSVNException
ISVNReporterBaton
,
ISVNReporter
,
ISVNEditor
,
Using ISVNReporter/ISVNEditor in update-related operationspublic void update(long revision, java.lang.String target, SVNDepth depth, boolean sendCopyFromArgs, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException
SVNRepository
target
is the name (one-level path component) of an entry that will
restrict the scope of the update to this entry. In other words target
is a child entry of the
directory represented by the repository location to which this object is set. For
example, if we have something like "/dirA/dirB"
in a repository, then
this object's repository location may be set to "svn://host:port/path/to/repos/dirA"
,
and target
may be "dirB"
.
If target
is null or empty (""
)
then the scope of the update operation is the repository location to which
this object is set.
The reporter
is used to describe the state of the local item(s) (i.e.
items' revision numbers, deleted, switched items). All the paths described by the
reporter
should be relative to the repository location to which this
object is set.
After that the editor
is used to carry out all the work on
updating. This editor
contains
knowledge of where the change will begin (when ISVNEditor.openRoot()
is called).
NOTE: you may not invoke methods of this SVNRepository
object from within the provided reporter
and editor
.
update
in class SVNRepository
revision
- a desired revision to make update to; defaults to
the latest revision (HEAD)target
- an entry name (optional)depth
- a depth for update operation, determines the scope of the updatereporter
- a caller's reportereditor
- a caller's editorSVNException
- in case the repository could not be connectedSVNAuthenticationException
- in case of authentication problemsSVNRepository.update(long, String, boolean, ISVNReporterBaton, ISVNEditor)
,
ISVNReporterBaton
,
ISVNReporter
,
ISVNEditor
,
Using ISVNReporter/ISVNEditor in update-related operationsprotected java.util.Map getMergeInfoImpl(java.lang.String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants) throws SVNException
getMergeInfoImpl
in class SVNRepository
SVNException
public boolean hasCapability(SVNCapability capability) throws SVNException
SVNRepository
true
if the repository has specified capability
.
This method may need to establish connection with the repository if information on capabilities
has not been received yet from the repository.hasCapability
in class SVNRepository
capability
- one of SVNCapability
SVNException
- in case the repository could not be connectedSVNAuthenticationException
- in case of authentication problemsSVNCapability
protected ISVNEditor getCommitEditorInternal(java.util.Map locks, boolean keepLocks, SVNProperties revProps, ISVNWorkspaceMediator mediator) throws SVNException
getCommitEditorInternal
in class SVNRepository
SVNException
protected void replayRangeImpl(long startRevision, long endRevision, long lowRevision, boolean sendDeltas, ISVNReplayHandler handler) throws SVNException
replayRangeImpl
in class SVNRepository
SVNException
protected long getDeletedRevisionImpl(java.lang.String path, long pegRevision, long endRevision) throws SVNException
getDeletedRevisionImpl
in class SVNRepository
SVNException
protected void getInheritedPropertiesImpl(java.lang.String path, long revision, java.lang.String propertyName, ISVNInheritedPropertiesHandler handler) throws SVNException
getInheritedPropertiesImpl
in class SVNRepository
SVNException
Copyright © 2004-2012 TMate Software Ltd. All Rights Reserved.