Class SVNBasicDelegate
- java.lang.Object
-
- org.tmatesoft.svn.core.internal.wc16.SVNBasicDelegate
-
- All Implemented Interfaces:
ISVNCanceller
,ISVNEventHandler
- Direct Known Subclasses:
SVNChangelistClient16
,SVNCommitClient16
,SVNCopyDriver
,SVNLogClient16
,SVNLogClient17
,SVNMergeDriver
,SVNStatusClient16
,SVNUpdateClient16
,SVNWCClient16
public class SVNBasicDelegate extends java.lang.Object implements ISVNEventHandler
The SVNBasicClient is the base class of all SVN*Client classes that provides a common interface and realization.All of SVN*Client classes use inherited methods of SVNBasicClient to access Working Copies metadata, to create a driver object to access a repository if it's necessary, etc. In addition SVNBasicClient provides some interface methods - such as those that allow you to set your
event handler
, obtain run-time configuration options, and others.- Since:
- 1.2
- Version:
- 1.3
- Author:
- TMate Software Ltd.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SVNBasicDelegate.RepositoryReference
protected static class
SVNBasicDelegate.SVNRepositoryLocation
-
Field Summary
-
Fields inherited from interface org.tmatesoft.svn.core.ISVNCanceller
NULL
-
Fields inherited from interface org.tmatesoft.svn.core.wc.ISVNEventHandler
UNKNOWN
-
-
Constructor Summary
Constructors Modifier Constructor Description SVNBasicDelegate(ISVNAuthenticationManager authManager, ISVNOptions options)
protected
SVNBasicDelegate(ISVNRepositoryPool repositoryPool, ISVNOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
checkCancelled()
Redirects this call to the registered event handler (if any).protected SVNRepository
createRepository(SVNURL url, java.io.File path, SVNAdminArea area, SVNRevision pegRevision, SVNRevision revision, long[] pegRev)
protected SVNRepository
createRepository(SVNURL url, java.io.File path, SVNWCAccess access, boolean mayReuse)
protected SVNRepository
createRepository(SVNURL url, java.lang.String uuid, boolean mayReuse)
protected SVNWCAccess
createWCAccess()
protected SVNWCAccess
createWCAccess(java.lang.String pathPrefix)
protected SVNURL
deriveLocation(java.io.File path, SVNURL url, long[] pegRevisionNumber, SVNRevision pegRevision, SVNRepository repos, SVNWCAccess access)
protected void
dispatchEvent(SVNEvent event)
protected void
dispatchEvent(SVNEvent event, double progress)
protected void
elideMergeInfo(SVNWCAccess access, java.io.File path, SVNEntry entry, java.io.File wcElisionLimitPath)
protected SVNURL
ensureSessionURL(SVNRepository repository, SVNURL url)
ISVNDebugLog
getDebugLog()
Returns the debug logger currently in use.protected SVNURL
getEntryLocation(java.io.File path, SVNEntry entry, long[] revNum, SVNRevision pegRevision)
protected ISVNEventHandler
getEventDispatcher()
protected int
getLevelsToLockFromDepth(SVNDepth depth)
protected SVNBasicDelegate.SVNRepositoryLocation[]
getLocations(SVNURL url, java.io.File path, SVNRepository repository, SVNRevision revision, SVNRevision start, SVNRevision end)
ISVNOptions
getOptions()
Gets run-time configuration options used by this object.protected long
getPathLastChangeRevision(java.lang.String relPath, long revision, SVNRepository repository)
protected java.lang.String
getPathRelativeToRoot(java.io.File path, SVNURL url, SVNURL reposRootURL, SVNWCAccess wcAccess, SVNRepository repos)
protected java.lang.String
getPathRelativeToSession(SVNURL url, SVNURL sessionURL, SVNRepository repos)
protected ISVNRepositoryPool
getRepositoryPool()
protected java.util.Map
getReposMergeInfo(SVNRepository repository, java.lang.String path, long revision, SVNMergeInfoInheritance inheritance, boolean squelchIncapable)
SVNURL
getReposRoot(java.io.File path, SVNURL url, SVNRevision pegRevision, SVNAdminArea adminArea, SVNWCAccess access)
Returns the root of the repository.protected long
getRevisionNumber(SVNRevision revision, long[] latestRevisionNumber, SVNRepository repository, java.io.File path)
protected long
getRevisionNumber(SVNRevision revision, SVNRepository repository, java.io.File path)
protected SVNURL
getURL(java.io.File path)
protected java.util.Map
getWCMergeInfo(java.io.File path, SVNEntry entry, java.io.File limitPath, SVNMergeInfoInheritance inherit, boolean base, boolean[] inherited)
mergeInfo must not be null!protected java.util.Map
getWCOrRepositoryMergeInfo(java.io.File path, SVNEntry entry, SVNMergeInfoInheritance inherit, boolean[] indirect, boolean reposOnly, SVNRepository repository)
void
handleEvent(SVNEvent event, double progress)
Dispatches events to the registered event handler (if any).void
handlePathListItem(java.io.File path)
Handles a next working copy path with thepath list handler
if any was provided to this object throughsetPathListHandler(ISVNPathListHandler)
.boolean
isIgnoreExternals()
Determines if externals definitions are ignored.boolean
isLeaveConflictsUnresolved()
Deprecated.this method should not be used anymoreprotected SVNRevision[]
resolveRevisions(SVNRevision pegRevision, SVNRevision revision, boolean isURL, boolean noticeLocalModifications)
protected void
setCommitItemAccess(SVNCommitItem item, SVNWCAccess access)
protected void
setCommitItemFlags(SVNCommitItem item, boolean contentModified, boolean propertiesModified)
protected void
setCommitItemProperty(SVNCommitItem item, java.lang.String name, SVNPropertyValue value)
void
setDebugLog(ISVNDebugLog log)
Sets a logger to write debug log information to.void
setEventHandler(ISVNEventHandler dispatcher)
Sets an event handler for this object.void
setEventPathPrefix(java.lang.String prefix)
Removes or adds a path prefix.void
setIgnoreExternals(boolean ignore)
Sets externals definitions to be ignored or not during operations.void
setLeaveConflictsUnresolved(boolean leave)
Deprecated.this method should not be used anymorevoid
setOptions(ISVNOptions options)
Sets run-time global configuration options to this object.void
setPathListHandler(ISVNPathListHandler handler)
Sets a path list handler implementation to this object.protected void
sleepForTimeStamp()
-
-
-
Constructor Detail
-
SVNBasicDelegate
public SVNBasicDelegate(ISVNAuthenticationManager authManager, ISVNOptions options)
-
SVNBasicDelegate
protected SVNBasicDelegate(ISVNRepositoryPool repositoryPool, ISVNOptions options)
-
-
Method Detail
-
getOptions
public ISVNOptions getOptions()
Gets run-time configuration options used by this object.- Returns:
- the run-time options being in use
-
setOptions
public void setOptions(ISVNOptions options)
Sets run-time global configuration options to this object.- Parameters:
options
- the run-time configuration options
-
setIgnoreExternals
public void setIgnoreExternals(boolean ignore)
Sets externals definitions to be ignored or not during operations.For example, if external definitions are set to be ignored then a checkout operation won't fetch them into a Working Copy.
- Parameters:
ignore
- true to ignore externals definitions, false - not to- See Also:
isIgnoreExternals()
-
isIgnoreExternals
public boolean isIgnoreExternals()
Determines if externals definitions are ignored.- Returns:
- true if ignored, otherwise false
- See Also:
setIgnoreExternals(boolean)
-
setLeaveConflictsUnresolved
public void setLeaveConflictsUnresolved(boolean leave)
Deprecated.this method should not be used anymoreSets (or unsets) all conflicted working files to be untouched by update and merge operations.By default when a file receives changes from the repository that are in conflict with local edits, an update operation places two sections for each conflicting snatch into the working file one of which is a user's local edit and the second is the one just received from the repository. Like this:
<<<<<<< .mine user's text ======= received text >>>>>>> .r2
Also the operation creates three temporary files that appear in the same directory as the working file. Now if you call this method withleave
set to true, an update will still create temporary files but won't place those two sections into your working file. And this behaviour also concerns merge operations: any merging to a conflicted file will be prevented. In addition if there is any registered event handler for an SVNDiffClient or SVNUpdateClient instance then the handler will be dispatched an event with the status type set toSVNStatusType.CONFLICTED_UNRESOLVED
.The default value is false until a caller explicitly changes it calling this method.
- Parameters:
leave
- true to prevent conflicted files from merging (all merging operations will be skipped), otherwise false- See Also:
isLeaveConflictsUnresolved()
,SVNUpdateClient
,SVNDiffClient
,ISVNEventHandler
-
isLeaveConflictsUnresolved
public boolean isLeaveConflictsUnresolved()
Deprecated.this method should not be used anymoreDetermines if conflicted files should be left unresolved preventing from merging their contents during update and merge operations.- Returns:
- true if conflicted files are set to be prevented from merging, false if there's no such restriction
- See Also:
setLeaveConflictsUnresolved(boolean)
-
setEventHandler
public void setEventHandler(ISVNEventHandler dispatcher)
Sets an event handler for this object. This event handler will be dispatchedSVNEvent
objects to provide detailed information about actions and progress state of version control operations performed by do*() methods of SVN*Client classes.- Parameters:
dispatcher
- an event handler
-
setPathListHandler
public void setPathListHandler(ISVNPathListHandler handler)
Sets a path list handler implementation to this object.- Parameters:
handler
- handler implementation- Since:
- 1.2.0
-
setDebugLog
public void setDebugLog(ISVNDebugLog log)
Sets a logger to write debug log information to.- Parameters:
log
- a debug logger
-
getDebugLog
public ISVNDebugLog getDebugLog()
Returns the debug logger currently in use.If no debug logger has been specified by the time this call occurs, a default one (returned by
org.tmatesoft.svn.util.SVNDebugLog.getDefaultLog()
) will be created and used.- Returns:
- a debug logger
-
getReposRoot
public SVNURL getReposRoot(java.io.File path, SVNURL url, SVNRevision pegRevision, SVNAdminArea adminArea, SVNWCAccess access) throws SVNException
Returns the root of the repository. Ifpath
is not null andpegRevision
is eitherSVNRevision.WORKING
orSVNRevision.BASE
, then attempts to fetch the repository root from the working copy represented bypath
. If these conditions are not met or if the repository root is not recorded in the working copy, then a repository connection is established and the repository root is fetched from the session. When fetching the repository root from the working copy and ifaccess
is null, a new working copy access will be created and the working copy will be opened non-recursively for reading only. All necessary cleanup (session or|and working copy close) will be performed automatically as the routine finishes.- Parameters:
path
- working copy pathurl
- repository urlpegRevision
- revision in which the target is validadminArea
- working copy administrative area objectaccess
- working copy access object- Returns:
- repository root url
- Throws:
SVNException
- Since:
- 1.2.0
-
sleepForTimeStamp
protected void sleepForTimeStamp()
-
createRepository
protected SVNRepository createRepository(SVNURL url, java.io.File path, SVNWCAccess access, boolean mayReuse) throws SVNException
- Throws:
SVNException
-
createRepository
protected SVNRepository createRepository(SVNURL url, java.lang.String uuid, boolean mayReuse) throws SVNException
- Throws:
SVNException
-
getRepositoryPool
protected ISVNRepositoryPool getRepositoryPool()
-
dispatchEvent
protected void dispatchEvent(SVNEvent event) throws SVNException
- Throws:
SVNException
-
dispatchEvent
protected void dispatchEvent(SVNEvent event, double progress) throws SVNException
- Throws:
SVNException
-
setEventPathPrefix
public void setEventPathPrefix(java.lang.String prefix)
Removes or adds a path prefix. This method is not intended for users (from an API point of view).- Parameters:
prefix
- a path prefix
-
getEventDispatcher
protected ISVNEventHandler getEventDispatcher()
-
createWCAccess
protected SVNWCAccess createWCAccess()
-
createWCAccess
protected SVNWCAccess createWCAccess(java.lang.String pathPrefix)
-
handleEvent
public void handleEvent(SVNEvent event, double progress) throws SVNException
Dispatches events to the registered event handler (if any).- Specified by:
handleEvent
in interfaceISVNEventHandler
- Parameters:
event
- the current eventprogress
- progress state (from 0 to 1)- Throws:
SVNException
-
handlePathListItem
public void handlePathListItem(java.io.File path) throws SVNException
Handles a next working copy path with thepath list handler
if any was provided to this object throughsetPathListHandler(ISVNPathListHandler)
. Note: used bySVNKit
internals.- Parameters:
path
- working copy path- Throws:
SVNException
- Since:
- 1.2.0
-
checkCancelled
public void checkCancelled() throws SVNCancelException
Redirects this call to the registered event handler (if any).- Specified by:
checkCancelled
in interfaceISVNCanceller
- Throws:
SVNCancelException
- if the current operation was cancelled
-
getRevisionNumber
protected long getRevisionNumber(SVNRevision revision, SVNRepository repository, java.io.File path) throws SVNException
- Throws:
SVNException
-
getRevisionNumber
protected long getRevisionNumber(SVNRevision revision, long[] latestRevisionNumber, SVNRepository repository, java.io.File path) throws SVNException
- Throws:
SVNException
-
createRepository
protected SVNRepository createRepository(SVNURL url, java.io.File path, SVNAdminArea area, SVNRevision pegRevision, SVNRevision revision, long[] pegRev) throws SVNException
- Throws:
SVNException
-
resolveRevisions
protected SVNRevision[] resolveRevisions(SVNRevision pegRevision, SVNRevision revision, boolean isURL, boolean noticeLocalModifications)
-
elideMergeInfo
protected void elideMergeInfo(SVNWCAccess access, java.io.File path, SVNEntry entry, java.io.File wcElisionLimitPath) throws SVNException
- Throws:
SVNException
-
getReposMergeInfo
protected java.util.Map getReposMergeInfo(SVNRepository repository, java.lang.String path, long revision, SVNMergeInfoInheritance inheritance, boolean squelchIncapable) throws SVNException
- Parameters:
path
- path relative to the repository location.- Throws:
SVNException
-
getWCOrRepositoryMergeInfo
protected java.util.Map getWCOrRepositoryMergeInfo(java.io.File path, SVNEntry entry, SVNMergeInfoInheritance inherit, boolean[] indirect, boolean reposOnly, SVNRepository repository) throws SVNException
- Throws:
SVNException
-
getWCMergeInfo
protected java.util.Map getWCMergeInfo(java.io.File path, SVNEntry entry, java.io.File limitPath, SVNMergeInfoInheritance inherit, boolean base, boolean[] inherited) throws SVNException
mergeInfo must not be null!- Throws:
SVNException
-
getPathLastChangeRevision
protected long getPathLastChangeRevision(java.lang.String relPath, long revision, SVNRepository repository) throws SVNException
- Throws:
SVNException
-
getPathRelativeToRoot
protected java.lang.String getPathRelativeToRoot(java.io.File path, SVNURL url, SVNURL reposRootURL, SVNWCAccess wcAccess, SVNRepository repos) throws SVNException
- Throws:
SVNException
-
getPathRelativeToSession
protected java.lang.String getPathRelativeToSession(SVNURL url, SVNURL sessionURL, SVNRepository repos)
-
getLocations
protected SVNBasicDelegate.SVNRepositoryLocation[] getLocations(SVNURL url, java.io.File path, SVNRepository repository, SVNRevision revision, SVNRevision start, SVNRevision end) throws SVNException
- Throws:
SVNException
-
getURL
protected SVNURL getURL(java.io.File path) throws SVNException
- Throws:
SVNException
-
deriveLocation
protected SVNURL deriveLocation(java.io.File path, SVNURL url, long[] pegRevisionNumber, SVNRevision pegRevision, SVNRepository repos, SVNWCAccess access) throws SVNException
- Throws:
SVNException
-
getEntryLocation
protected SVNURL getEntryLocation(java.io.File path, SVNEntry entry, long[] revNum, SVNRevision pegRevision) throws SVNException
- Throws:
SVNException
-
ensureSessionURL
protected SVNURL ensureSessionURL(SVNRepository repository, SVNURL url) throws SVNException
- Throws:
SVNException
-
getLevelsToLockFromDepth
protected int getLevelsToLockFromDepth(SVNDepth depth)
-
setCommitItemAccess
protected void setCommitItemAccess(SVNCommitItem item, SVNWCAccess access)
-
setCommitItemProperty
protected void setCommitItemProperty(SVNCommitItem item, java.lang.String name, SVNPropertyValue value)
-
setCommitItemFlags
protected void setCommitItemFlags(SVNCommitItem item, boolean contentModified, boolean propertiesModified)
-
-