|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.scm.SCM
hudson.scm.NullSCM
public class NullSCM
No SCM
.
Nested Class Summary | |
---|---|
static class |
NullSCM.DescriptorImpl
|
Nested classes/interfaces inherited from interface hudson.ExtensionPoint |
---|
ExtensionPoint.LegacyInstancesAreScopedToHudson |
Field Summary |
---|
Fields inherited from class hudson.scm.SCM |
---|
PERMISSIONS, TAG |
Constructor Summary | |
---|---|
NullSCM()
|
Method Summary | |
---|---|
SCMRevisionState |
calcRevisionsFromBuild(AbstractBuild<?,?> build,
Launcher launcher,
TaskListener listener)
Calculates the SCMRevisionState that represents the state of the workspace of the given build. |
boolean |
checkout(AbstractBuild<?,?> build,
Launcher launcher,
FilePath remoteDir,
BuildListener listener,
File changeLogFile)
Obtains a fresh workspace of the module(s) into the specified directory of the specified machine. |
protected PollingResult |
compareRemoteRevisionWith(AbstractProject project,
Launcher launcher,
FilePath workspace,
TaskListener listener,
SCMRevisionState baseline)
Compares the current state of the remote repository against the given baseline SCMRevisionState . |
ChangeLogParser |
createChangeLogParser()
The returned object will be used to parse changelog.xml. |
Methods inherited from class hudson.scm.SCM |
---|
_calcRevisionsFromBuild, _for, all, buildEnvVars, createEmptyChangeLog, getApi, getBrowser, getDescriptor, getEffectiveBrowser, getModuleRoot, getModuleRoot, getModuleRoots, getModuleRoots, getType, nullify, poll, pollChanges, processWorkspaceBeforeDeletion, requiresWorkspaceForPolling, supportsPolling |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NullSCM()
Method Detail |
---|
public SCMRevisionState calcRevisionsFromBuild(AbstractBuild<?,?> build, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
SCM
SCMRevisionState
that represents the state of the workspace of the given build.
The returned object is then fed into the
SCM.compareRemoteRevisionWith(AbstractProject, Launcher, FilePath, TaskListener, SCMRevisionState)
method
as the baseline SCMRevisionState
to determine if the build is necessary.
This method is called after source code is checked out for the given build (that is, after
SCM.checkout(AbstractBuild, Launcher, FilePath, BuildListener, File)
has finished successfully.)
The obtained object is added to the build as an Action
for later retrieval. As an optimization,
SCM
implementation can choose to compute SCMRevisionState
and add it as an action
during check out, in which case this method will not called.
calcRevisionsFromBuild
in class SCM
build
- The calculated SCMRevisionState
is for the files checked out in this build. Never null.
If SCM.requiresWorkspaceForPolling()
returns true, Hudson makes sure that the workspace of this
build is available and accessible by the callee.launcher
- Abstraction of the machine where the polling will take place. If SCM declares
that the polling doesn't require a workspace,
this parameter is null. Otherwise never null.listener
- Logs during the polling should be sent here.
InterruptedException
- interruption is usually caused by the user aborting the computation.
this exception should be simply propagated all the way up.
IOException
protected PollingResult compareRemoteRevisionWith(AbstractProject project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException
SCM
SCMRevisionState
.
Conceptually, the act of polling is to take two states of the repository and to compare them to see if there's any difference. In practice, however, comparing two arbitrary repository states is an expensive operation, so in this abstraction, we chose to mix (1) the act of building up a repository state and (2) the act of comparing it with the earlier state, so that SCM implementations can implement this more easily.
Multiple invocations of this method may happen over time to make sure that the remote repository is "quiet" before Hudson schedules a new build.
compareRemoteRevisionWith
in class SCM
project
- The project to check for updateslauncher
- Abstraction of the machine where the polling will take place. If SCM declares
that the polling doesn't require a workspace, this parameter is null.workspace
- The workspace directory that contains baseline files. If SCM declares
that the polling doesn't require a workspace, this parameter is null.listener
- Logs during the polling should be sent here.baseline
- The baseline of the comparison. This object is the return value from earlier
SCM.compareRemoteRevisionWith(AbstractProject, Launcher, FilePath, TaskListener, SCMRevisionState)
or
SCM.calcRevisionsFromBuild(AbstractBuild, Launcher, TaskListener)
.
PollingResult
value type.
PollingResult.baseline
should be the value of the baseline parameter, PollingResult.remote
is the current state of the remote repository (this object only needs to be understandable to the future
invocations of this method),
and PollingResult.change
that indicates the degree of changes found during the comparison.
InterruptedException
- interruption is usually caused by the user aborting the computation.
this exception should be simply propagated all the way up.
IOException
public boolean checkout(AbstractBuild<?,?> build, Launcher launcher, FilePath remoteDir, BuildListener listener, File changeLogFile) throws IOException, InterruptedException
SCM
The "update" operation can be performed instead of a fresh checkout if feasible.
This operation should also capture the information necessary to tag the workspace later.
checkout
in class SCM
launcher
- Abstracts away the machine that the files will be checked out.remoteDir
- a directory to check out the source code. May contain left-over
from the previous build.changeLogFile
- Upon a successful return, this file should capture the changelog.
When there's no change, this file should contain an empty entry.
See SCM.createEmptyChangeLog(File, BuildListener, String)
.
Using the return value to indicate success/failure should
be considered deprecated, and implementations are encouraged
to throw AbortException
to indicate a failure.
InterruptedException
- interruption is usually caused by the user aborting the build.
this exception will cause the build to be aborted.
IOException
public ChangeLogParser createChangeLogParser()
SCM
createChangeLogParser
in class SCM
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |