Class SubversionSCM
- All Implemented Interfaces:
ExtensionPoint,Describable<SCM>
Plugin Developer Notes
Plugins that interact with Subversion can use SubversionSCM.DescriptorImpl.createAuthenticationProvider(AbstractProject)
so that it can use the credentials (username, password, etc.) that the user entered for Jenkins.
See the javadoc of this method for the precautions you need to take if you run Subversion operations
remotely on slaves.
Implementation Notes
Because this instance refers to some other classes that are not necessarily
Java serializable (like browser), remotable FilePath.FileCallables all
need to be declared as static inner classes.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic final classInformation about svn:externalstatic final classsmall structure to store local and remote (repository) location information of the repository.static final classNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIf set to non-null, read configuration from this directory instead of "~/.subversion".static final intNetwork timeout in milliseconds.Fields inherited from class hudson.scm.SCM
PERMISSIONS, TAG -
Constructor Summary
ConstructorsConstructorDescriptionSubversionSCM(String svnUrl) Convenience constructor, especially during testing.SubversionSCM(String[] svnUrls, String[] locals) Convenience constructor, especially during testing.SubversionSCM(String[] remoteLocations, String[] localLocations, boolean useUpdate, SubversionRepositoryBrowser browser) Deprecated.as of 1.286SubversionSCM(String[] remoteLocations, String[] localLocations, boolean useUpdate, SubversionRepositoryBrowser browser, String excludedRegions) Deprecated.as of 1.311SubversionSCM(String[] remoteLocations, String[] localLocations, boolean useUpdate, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop) Deprecated.as of 1.315SubversionSCM(String[] svnUrls, String[] credentialIds, String[] locals) Convenience constructor, especially during testing.SubversionSCM(String svnUrl, String local) Convenience constructor, especially during testing.SubversionSCM(String svnUrl, String credentialId, String local) Convenience constructor, especially during testing.SubversionSCM(String svnUrl, String credentialId, String local, WorkspaceUpdater workspaceUpdater, SubversionRepositoryBrowser browser) Convenience constructor, especially during testing.SubversionSCM(List<SubversionSCM.ModuleLocation> locations, boolean useUpdate, boolean doRevert, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages) Deprecated.as of 1.xxxSubversionSCM(List<SubversionSCM.ModuleLocation> locations, boolean useUpdate, boolean doRevert, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions) Deprecated.as of 1.23SubversionSCM(List<SubversionSCM.ModuleLocation> locations, boolean useUpdate, SubversionRepositoryBrowser browser, String excludedRegions) Deprecated.as of 1.315SubversionSCM(List<SubversionSCM.ModuleLocation> locations, boolean useUpdate, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop) Deprecated.as of 1.324SubversionSCM(List<SubversionSCM.ModuleLocation> locations, boolean useUpdate, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages) Deprecated.as of 1.328SubversionSCM(List<SubversionSCM.ModuleLocation> locations, WorkspaceUpdater workspaceUpdater, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions) Deprecated.as of ...SubversionSCM(List<SubversionSCM.ModuleLocation> locations, WorkspaceUpdater workspaceUpdater, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions, boolean ignoreDirPropChanges) Deprecated.SubversionSCM(List<SubversionSCM.ModuleLocation> locations, WorkspaceUpdater workspaceUpdater, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions, boolean ignoreDirPropChanges, boolean filterChangelog, List<SubversionSCM.AdditionalCredentials> additionalCredentials) Deprecated.by quietOperationSubversionSCM(List<SubversionSCM.ModuleLocation> locations, WorkspaceUpdater workspaceUpdater, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions, boolean ignoreDirPropChanges, boolean filterChangelog, List<SubversionSCM.AdditionalCredentials> additionalCredentials, boolean quietOperation) -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildEnvironment(Run<?, ?> build, Map<String, String> env) Sets theSVN_REVISION_nandSVN_URL_nenvironment variables during the build.calcRevisionsFromBuild(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) voidcheckout(Run build, Launcher launcher, FilePath workspace, TaskListener listener, File changelogFile, SCMRevisionState baseline) compareRemoteRevisionWith(Job<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState _baseline) org.tmatesoft.svn.core.auth.ISVNAuthenticationProvidercreateAuthenticationProvider(Job<?, ?> inContextOf, SubversionSCM.ModuleLocation location) Deprecated.org.tmatesoft.svn.core.auth.ISVNAuthenticationProvidercreateAuthenticationProvider(Job<?, ?> inContextOf, SubversionSCM.ModuleLocation location, TaskListener listener) CreatesISVNAuthenticationProvider.static SvnClientManagercreateClientManager(AbstractProject context) CreatesSVNClientManagerfor code running on the master.static SvnClientManagercreateClientManager(org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider authProvider) Deprecated.static SvnClientManagercreateClientManager(org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider authProvider, boolean storeAuthToDisk, int workspaceFormat) CreatesSVNClientManager.static org.tmatesoft.svn.core.internal.wc.DefaultSVNOptionscreateDefaultSVNOptions(boolean storeAuthToDisk) Creates theDefaultSVNOptions.static org.tmatesoft.svn.core.auth.ISVNAuthenticationManagercreateSvnAuthenticationManager(org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider authProvider) static org.tmatesoft.svn.core.wc.SVNClientManagercreateSvnClientManager(AbstractProject context) Deprecated.as of 2.0 UsecreateClientManager(AbstractProject)static org.tmatesoft.svn.core.wc.SVNClientManagercreateSvnClientManager(org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider authProvider) Deprecated.static SubversionSCM.DescriptorImplstatic voidenableSshDebug(Level level) Deprecated.Logging all goes to JDK java.util.loggingString[]String[]String[]getKey()list of all configured svn locationsgetLocations(EnvVars env, Run<?, ?> build) List of all configured svn locations, expanded according to all env vars or, if none defined, according to only build parameters values.getLocations(AbstractBuild<?, ?> build) Deprecated.UsegetLocations(EnvVars, Run)for vars expansion to be performed on all env vars rather than just build parameters.getModuleRoot(FilePath workspace) Deprecated.getModuleRoot(FilePath workspace, AbstractBuild build) FilePath[]getModuleRoots(FilePath workspace) Deprecated.FilePath[]getModuleRoots(FilePath workspace, AbstractBuild build) Deprecated.as of 1.91.getProjectLocations(Job project) Get the list of every checked-out location.static FilegetRevisionFile(AbstractBuild build) Deprecated.usegetRevisionFile(hudson.model.Run)instead.static FilegetRevisionFile(Run build) Gets the file that stores the revision.static voidinit(int workspaceFormat) booleanbooleanbooleanstatic voidbooleanrepositoryLocationsNoLongerExist(AbstractBuild<?, ?> build, TaskListener listener) Deprecated.1.34booleanrepositoryLocationsNoLongerExist(Run<?, ?> build, TaskListener listener, EnvVars env) booleanPolling can happen on the master and does not require a workspace.voidsetQuietOperation(boolean quietOperation) Convenience method solely for testing.voidsetWorkspaceUpdater(WorkspaceUpdater workspaceUpdater) Methods inherited from class hudson.scm.SCM
_calcRevisionsFromBuild, _for, _for, all, buildEnvVars, calcRevisionsFromBuild, checkout, compareRemoteRevisionWith, createEmptyChangeLog, createEmptyChangeLog, getApi, getEffectiveBrowser, getType, guessBrowser, nullify, poll, pollChanges, postCheckout, postCheckout, processWorkspaceBeforeDeletion, processWorkspaceBeforeDeletion, supportsPolling
-
Field Details
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUTNetwork timeout in milliseconds. The main point of this is to prevent infinite hang, so it should be a rather long value to avoid accidental time out problem. -
CONFIG_DIR
If set to non-null, read configuration from this directory instead of "~/.subversion".
-
-
Constructor Details
-
SubversionSCM
public SubversionSCM(String[] remoteLocations, String[] localLocations, boolean useUpdate, SubversionRepositoryBrowser browser) Deprecated.as of 1.286 -
SubversionSCM
public SubversionSCM(String[] remoteLocations, String[] localLocations, boolean useUpdate, SubversionRepositoryBrowser browser, String excludedRegions) Deprecated.as of 1.311 -
SubversionSCM
public SubversionSCM(String[] remoteLocations, String[] localLocations, boolean useUpdate, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop) Deprecated.as of 1.315 -
SubversionSCM
public SubversionSCM(List<SubversionSCM.ModuleLocation> locations, boolean useUpdate, SubversionRepositoryBrowser browser, String excludedRegions) Deprecated.as of 1.315 -
SubversionSCM
public SubversionSCM(List<SubversionSCM.ModuleLocation> locations, boolean useUpdate, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop) Deprecated.as of 1.324 -
SubversionSCM
public SubversionSCM(List<SubversionSCM.ModuleLocation> locations, boolean useUpdate, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages) Deprecated.as of 1.328 -
SubversionSCM
public SubversionSCM(List<SubversionSCM.ModuleLocation> locations, boolean useUpdate, boolean doRevert, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages) Deprecated.as of 1.xxx -
SubversionSCM
public SubversionSCM(List<SubversionSCM.ModuleLocation> locations, boolean useUpdate, boolean doRevert, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions) Deprecated.as of 1.23 -
SubversionSCM
public SubversionSCM(List<SubversionSCM.ModuleLocation> locations, WorkspaceUpdater workspaceUpdater, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions) Deprecated.as of ... -
SubversionSCM
public SubversionSCM(List<SubversionSCM.ModuleLocation> locations, WorkspaceUpdater workspaceUpdater, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions, boolean ignoreDirPropChanges) Deprecated. -
SubversionSCM
public SubversionSCM(List<SubversionSCM.ModuleLocation> locations, WorkspaceUpdater workspaceUpdater, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions, boolean ignoreDirPropChanges, boolean filterChangelog, List<SubversionSCM.AdditionalCredentials> additionalCredentials) Deprecated.by quietOperation -
SubversionSCM
@DataBoundConstructor public SubversionSCM(List<SubversionSCM.ModuleLocation> locations, WorkspaceUpdater workspaceUpdater, SubversionRepositoryBrowser browser, String excludedRegions, String excludedUsers, String excludedRevprop, String excludedCommitMessages, String includedRegions, boolean ignoreDirPropChanges, boolean filterChangelog, List<SubversionSCM.AdditionalCredentials> additionalCredentials, boolean quietOperation) -
SubversionSCM
Convenience constructor, especially during testing. -
SubversionSCM
Convenience constructor, especially during testing. -
SubversionSCM
Convenience constructor, especially during testing. -
SubversionSCM
public SubversionSCM(String svnUrl, String credentialId, String local, WorkspaceUpdater workspaceUpdater, SubversionRepositoryBrowser browser) Convenience constructor, especially during testing. -
SubversionSCM
Convenience constructor, especially during testing. -
SubversionSCM
Convenience constructor, especially during testing.
-
-
Method Details
-
getModules
Deprecated.as of 1.91. UsegetLocations()instead. -
getLocations
list of all configured svn locations- Since:
- 1.91
-
getKey
-
getAdditionalCredentials
-
getWorkspaceUpdater
-
setWorkspaceUpdater
-
getLocations
Deprecated.UsegetLocations(EnvVars, Run)for vars expansion to be performed on all env vars rather than just build parameters.- Since:
- 1.252
-
getLocations
List of all configured svn locations, expanded according to all env vars or, if none defined, according to only build parameters values. Both may be defined, in which case the variables are combined.- Parameters:
env- If non-null, variable expansions are performed against these varsbuild- If non-null, variable expansions are performed against the build parameters
-
getProjectLocations
Get the list of every checked-out location. This differs fromgetLocations()which returns only the configured locations whereas this method returns the configured locations + any svn:externals locations.- Throws:
IOException
-
getBrowser
- Overrides:
getBrowserin classSCM
-
getExcludedRegions
-
getExcludedRegionsNormalized
-
getIncludedRegions
-
getIncludedRegionsNormalized
-
getExcludedUsers
-
getExcludedUsersNormalized
-
getExcludedRevprop
-
getExcludedCommitMessages
-
getExcludedCommitMessagesNormalized
-
isIgnoreDirPropChanges
@Exported public boolean isIgnoreDirPropChanges() -
isFilterChangelog
@Exported public boolean isFilterChangelog() -
isQuietOperation
@Exported public boolean isQuietOperation() -
setQuietOperation
public void setQuietOperation(boolean quietOperation) Convenience method solely for testing. -
buildEnvironment
Sets theSVN_REVISION_nandSVN_URL_nenvironment variables during the build.- Overrides:
buildEnvironmentin classSCM
-
requiresWorkspaceForPolling
public boolean requiresWorkspaceForPolling()Polling can happen on the master and does not require a workspace.- Overrides:
requiresWorkspaceForPollingin classSCM
-
checkout
public void checkout(Run build, Launcher launcher, FilePath workspace, TaskListener listener, File changelogFile, SCMRevisionState baseline) throws IOException, InterruptedException - Overrides:
checkoutin classSCM- Throws:
IOExceptionInterruptedException
-
createSvnClientManager
public static org.tmatesoft.svn.core.wc.SVNClientManager createSvnClientManager(org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider authProvider) Deprecated. -
createClientManager
public static SvnClientManager createClientManager(org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider authProvider, boolean storeAuthToDisk, int workspaceFormat) CreatesSVNClientManager.This method must be executed on the slave where svn operations are performed.
- Parameters:
authProvider- The value obtained fromcreateAuthenticationProvider(Job,ModuleLocation, TaskListener). If the operation runs on slaves, (and properly remoted, if the svn operations run on slaves.)
-
createClientManager
@Deprecated public static SvnClientManager createClientManager(org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider authProvider) Deprecated. -
createDefaultSVNOptions
public static org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions createDefaultSVNOptions(boolean storeAuthToDisk) Creates theDefaultSVNOptions.- Returns:
- the
DefaultSVNOptions.
-
createSvnAuthenticationManager
public static org.tmatesoft.svn.core.auth.ISVNAuthenticationManager createSvnAuthenticationManager(org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider authProvider) -
createSvnClientManager
public static org.tmatesoft.svn.core.wc.SVNClientManager createSvnClientManager(AbstractProject context) Deprecated.as of 2.0 UsecreateClientManager(AbstractProject) -
createClientManager
CreatesSVNClientManagerfor code running on the master.CAUTION: this code only works when invoked on master. On slaves, use
createSvnClientManager(ISVNAuthenticationProvider)and getISVNAuthenticationProviderfrom the master via remoting. -
createAuthenticationProvider
public org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider createAuthenticationProvider(Job<?, ?> inContextOf, SubversionSCM.ModuleLocation location, TaskListener listener) CreatesISVNAuthenticationProvider. This method must be invoked on the master, but the returned object is remotable.Therefore, to access
ISVNAuthenticationProvider, you need to call this method on the master, then pass the object to the slave side, then callcreateSvnClientManager(ISVNAuthenticationProvider)on the slave. -
createAuthenticationProvider
@Deprecated public org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider createAuthenticationProvider(Job<?, ?> inContextOf, SubversionSCM.ModuleLocation location) Deprecated. -
getRevisionFile
Gets the file that stores the revision. -
getRevisionFile
Deprecated.usegetRevisionFile(hudson.model.Run)instead. Gets the file that stores the revision. -
calcRevisionsFromBuild
public SCMRevisionState calcRevisionsFromBuild(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException- Overrides:
calcRevisionsFromBuildin classSCM- Throws:
IOExceptionInterruptedException
-
compareRemoteRevisionWith
public PollingResult compareRemoteRevisionWith(Job<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState _baseline) throws IOException, InterruptedException- Overrides:
compareRemoteRevisionWithin classSCM- Throws:
IOExceptionInterruptedException
-
createSVNLogFilter
-
createChangeLogParser
- Specified by:
createChangeLogParserin classSCM
-
getDescriptor
- Specified by:
getDescriptorin interfaceDescribable<SCM>- Overrides:
getDescriptorin classSCM
-
getModuleRoot
Deprecated.- Overrides:
getModuleRootin classSCM
-
getModuleRoot
- Overrides:
getModuleRootin classSCM
-
getModuleRoots
Deprecated.- Overrides:
getModuleRootsin classSCM
-
getModuleRoots
- Overrides:
getModuleRootsin classSCM
-
perJobCredentialsMigration
-
descriptor
-
repositoryLocationsNoLongerExist
Deprecated.1.34 -
repositoryLocationsNoLongerExist
- Since:
- 1.34
-
init
public static void init(int workspaceFormat) -
enableSshDebug
Deprecated.Logging all goes to JDK java.util.loggingEnables trace logging of Ganymed SSH library.Intended to be invoked from Groovy console.
-