|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin com.atlassian.bamboo.v2.build.BaseConfigurablePlugin com.atlassian.bamboo.repository.AbstractRepository com.atlassian.bamboo.repository.AbstractStandaloneRepository com.atlassian.bamboo.plugins.hg.HgRepository
public class HgRepository
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.bamboo.repository.CachingAwareRepository |
---|
CachingAwareRepository.CachableOperation |
Field Summary | |
---|---|
static java.util.regex.Pattern |
branchesPattern
|
Fields inherited from class com.atlassian.bamboo.repository.AbstractRepository |
---|
BUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, customVariableContext, REPO_PREFIX, repositoryModuleDescriptor, templateRenderer, textProvider |
Fields inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin |
---|
moduleDescriptor |
Fields inherited from interface com.atlassian.bamboo.repository.IncludeExcludeAwareRepository |
---|
FILTER_PATTERN_EXCLUDE, FILTER_PATTERN_INCLUDE, FILTER_PATTERN_OPTION, FILTER_PATTERN_REGEX |
Fields inherited from interface com.atlassian.bamboo.repository.FilterChangesetAwareRepository |
---|
CHANGESET_FILTER_PATTERN_REGEX, MAVEN_RELEASE_PLUGIN_EXCLUSION_PATTERN |
Constructor Summary | |
---|---|
HgRepository()
|
Method Summary | |
---|---|
void |
addDefaultValues(BuildConfiguration buildConfiguration)
Extension point for adding default values to the form for RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) |
BuildRepositoryChanges |
collectChangesSinceLastBuild(java.lang.String planKey,
java.lang.String lastVcsRevisionKey)
Collects the changes since the lastVcsRevisionKey. |
java.lang.String |
commit(java.io.File sourceDirectory,
java.lang.String message)
Perform a commit (dvcs commit). |
void |
deleteCaches(java.util.Collection<java.lang.String> keys,
com.opensymphony.xwork.ValidationAware feedback)
Delete the specified caches, handling internal data updates etc. |
void |
deleteUnusedCaches(com.opensymphony.xwork.ValidationAware feedback)
Delete all unused caches. |
AuthenticationType |
getAuthenticationType()
|
java.util.List<AuthenticationType> |
getAuthenticationTypes()
|
java.lang.String |
getBranch()
Deprecated. since 4.0 use methods) |
static java.io.File |
getCacheBaseDirectory(BuildDirectoryManager buildDirectoryManager)
Separate static method so we can define the cache base directory in one place |
java.util.Collection<CacheDescription> |
getCacheDescriptions()
Collection of cache descriptions to be displayed in the admin UI. |
java.io.File |
getCacheDirectory()
|
static java.io.File |
getCacheDirectory(java.io.File baseDirectory,
java.lang.String repositoryUrl,
java.lang.String username)
|
CacheId |
getCacheId(CachingAwareRepository.CachableOperation cachableOperation)
Cache id has to fulfill the following: Given two Repository objects A and B, returning equal CacheId (in terms of equals()) and a cachable operation foo(), in the following sequence of calls made in a short time period: 1. |
int |
getCommandTimeout()
|
java.util.Map<java.lang.String,java.lang.String> |
getCustomVariables()
Return a map containing name->value mapping of the variables. |
CommitContext |
getFirstCommit()
Retrieve the commit that created the Branch. |
java.lang.String |
getHandlerDescription()
Additional information about this cache type that would be displayed in UI. |
java.lang.String |
getHgExeCapability()
|
java.lang.String |
getHost()
What's the repository server host |
CommitContext |
getLastCommit()
Retrieve last commit on the branch set on this Repository. |
java.lang.String |
getLocationIdentifier()
A string representing the location of the repository |
MavenPomAccessor |
getMavenPomAccessor()
|
java.lang.String |
getName()
The display name for the repository type |
java.util.List<VcsBranch> |
getOpenBranches()
Set of open branches that are discovered in the repository. |
java.lang.String |
getOptionDescription()
|
java.util.List<Plan> |
getOtherPlansSharingCache(Plan current)
|
java.lang.String |
getPassword()
|
java.net.URI |
getRemoteUri()
|
java.lang.String |
getRepositoryUrl()
|
java.util.Set<Requirement> |
getRequirements()
|
boolean |
getSshCompression()
|
java.lang.String |
getSshExeCapability()
|
java.lang.String |
getSubstitutedBranch()
|
java.lang.String |
getSubstitutedRepositoryUrl()
|
java.lang.String |
getSubstitutedRepositoryUrl(java.lang.String repositoryUrl)
|
java.lang.String |
getSubstitutedUserName()
|
java.lang.String |
getSubstitutedUserName(java.lang.String username)
|
java.lang.String |
getUsername()
|
VcsBranch |
getVcsBranch()
|
boolean |
isCachingSupportedFor(CachingAwareRepository.CachableOperation cachableOperation)
|
boolean |
isHgExecutableSet()
For configuration screens |
boolean |
isMergingSupported()
|
boolean |
isNoRepositoryCache()
|
boolean |
isRepositoryDifferent(Repository repository)
Checks if the current repo is the same as the given repository |
boolean |
isVerboseLogs()
|
protected boolean |
isWorkspaceEmpty(java.io.File sourceCodeDirectory)
|
boolean |
mergeWorkspaceWith(BuildContext buildContext,
java.io.File workspace,
java.lang.String targetRevision)
Merges a workspace located in checkout directory with the target revision. |
void |
populateFromConfig(org.apache.commons.configuration.HierarchicalConfiguration config)
Update the current object with data in the HierarchicalConfiguration |
void |
prepareConfigObject(BuildConfiguration buildConfiguration)
Do any preprocessing work before validation occurs. |
void |
pushRevision(java.io.File sourceDirectory,
java.lang.String vcsRevisionKey)
Push the specified revision to the remote directory. |
java.lang.String |
retrieveSourceCode(BuildContext buildContext,
java.lang.String vcsRevisionKey,
java.io.File sourceDirectory)
Checks out the latest source code from an appropriate repository to specified directory |
java.lang.String |
retrieveSourceCode(BuildContext buildContext,
java.lang.String vcsRevisionKey,
java.io.File sourceDirectory,
int depth)
So far mercurial cannot retrieve a "shallow" clone of repository so we're ignoring depth argument |
void |
setAuthenticationType(AuthenticationType authenticationType)
|
void |
setBranch(java.lang.String branch)
Deprecated. since 4.0 use methods) |
void |
setBranchIntegrationHelper(BranchIntegrationHelper branchIntegrationHelper)
|
void |
setCapabilityContext(CapabilityContext capabilityContext)
|
void |
setCommandTimeout(int commandTimeout)
|
void |
setHgCacheHandler(HgCacheHandler hgCacheHandler)
|
void |
setNoRepositoryCache(boolean noRepositoryCache)
|
void |
setPassword(java.lang.String password)
|
void |
setRepositoryModuleDesciptor(RepositoryModuleDescriptor repositoryModuleDescriptor)
|
void |
setSshProxyService(SshProxyService sshProxyService)
|
void |
setTextProvider(com.opensymphony.xwork.TextProvider textProvider)
|
void |
setUsername(java.lang.String username)
|
void |
setVcsBranch(VcsBranch branch)
Set and prepare the repository for using an arbitrary branch. |
void |
setVerboseLogs(boolean verboseLogs)
|
org.apache.commons.configuration.HierarchicalConfiguration |
toConfiguration()
Generate a HierarchicalConfiguration from the current state of the object |
ErrorCollection |
validate(BuildConfiguration buildConfiguration)
Validates the properties in the BuildConfiguration object. |
Methods inherited from class com.atlassian.bamboo.repository.AbstractStandaloneRepository |
---|
getAdvancedEditHtml, getAdvancedViewHtml, getEditHtml, getViewHtml |
Methods inherited from class com.atlassian.bamboo.v2.build.BaseConfigurablePlugin |
---|
customizeBuildRequirements, removeBuildRequirements |
Methods inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin |
---|
isConfigurationMissing, populateContextForEdit, populateContextForView |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.bamboo.repository.CacheHandler |
---|
getKey |
Methods inherited from interface com.atlassian.bamboo.repository.AdvancedConfigurationAwareRepository |
---|
getAdvancedEditHtml, getAdvancedViewHtml |
Methods inherited from interface com.atlassian.bamboo.repository.BranchMergingAwareRepository |
---|
getBranchIntegrationEditHtml |
Field Detail |
---|
public static final java.util.regex.Pattern branchesPattern
Constructor Detail |
---|
public HgRepository()
Method Detail |
---|
@NotNull public java.lang.String getName()
Repository
getName
in interface CacheHandler
getName
in interface Repository
getName
in interface DescriptionProvider
getName
in interface NameProvider
public java.lang.String getHost()
Repository
getHost
in interface Repository
@NotNull public java.lang.String getLocationIdentifier()
Repository
getLocationIdentifier
in interface Repository
getLocationIdentifier
in class AbstractRepository
public boolean isRepositoryDifferent(@NotNull Repository repository)
RepositoryV2
isRepositoryDifferent
in interface RepositoryV2
repository
- to compare against
@NotNull public java.io.File getCacheDirectory()
public static java.io.File getCacheBaseDirectory(BuildDirectoryManager buildDirectoryManager)
buildDirectoryManager
- buildDirectoryManager to get the locations from
DeleteHgCacheDirectoryOnAgentMessage
@NotNull public static java.io.File getCacheDirectory(java.io.File baseDirectory, java.lang.String repositoryUrl, @Nullable java.lang.String username)
@NotNull public java.lang.String commit(@NotNull java.io.File sourceDirectory, @NotNull java.lang.String message) throws RepositoryException
PushCapableRepository
commit
in interface PushCapableRepository
sourceDirectory
- - which workspace directory to perform the commitmessage
- - what message use for commit
RepositoryException
- - when something goes wrongpublic void pushRevision(@NotNull java.io.File sourceDirectory, @Nullable java.lang.String vcsRevisionKey) throws RepositoryException
PushCapableRepository
pushRevision
in interface PushCapableRepository
sourceDirectory
- - the working directory of the repository we want to push fromvcsRevisionKey
- - the revisionKey (usually a branch name) to push
RepositoryException
- - when something goes wrong@NotNull public java.util.List<VcsBranch> getOpenBranches() throws RepositoryException
BranchDetectionCapableRepository
Set
of open branches that are discovered in the repository. Returns empty collection if no branches at
all (can that happen?). Used for monitoring repositories for new branches.
An open branch is a branch that is considered 'open' by underlying VCS - it has nothing to do with the actual
development on that branch (recent commits or so).
getOpenBranches
in interface BranchDetectionCapableRepository
List
of branch names. May be empty.
RepositoryException
public CacheId getCacheId(@NotNull CachingAwareRepository.CachableOperation cachableOperation)
CachingAwareRepository
getCacheId
in interface CachingAwareRepository
public boolean isCachingSupportedFor(@NotNull CachingAwareRepository.CachableOperation cachableOperation)
isCachingSupportedFor
in interface CachingAwareRepository
@NotNull public VcsBranch getVcsBranch()
getVcsBranch
in interface BranchAwareRepository
public void setVcsBranch(@NotNull VcsBranch branch)
BranchAwareRepository
setVcsBranch
in interface BranchAwareRepository
public CommitContext getLastCommit() throws RepositoryException
BranchDetectionCapableRepository
getLastCommit
in interface BranchDetectionCapableRepository
RepositoryException
public CommitContext getFirstCommit() throws RepositoryException
BranchDetectionCapableRepository
getFirstCommit
in interface BranchDetectionCapableRepository
RepositoryException
@NotNull public BuildRepositoryChanges collectChangesSinceLastBuild(@NotNull java.lang.String planKey, @Nullable java.lang.String lastVcsRevisionKey) throws RepositoryException
RepositoryV2
collectChangesSinceLastBuild
in interface RepositoryV2
lastVcsRevisionKey
- can be null, if null you should ensure the correct vcsrevisionkey is returned in the BuildChanges object.
RepositoryException
- if something goes wrong@NotNull public java.lang.String retrieveSourceCode(@NotNull BuildContext buildContext, @Nullable java.lang.String vcsRevisionKey, @NotNull java.io.File sourceDirectory) throws RepositoryException
CustomSourceDirectoryAwareRepository
retrieveSourceCode
in interface CustomSourceDirectoryAwareRepository
vcsRevisionKey
- - may be null if you want latest codesourceDirectory
- - directory to checkout to
RepositoryException
@NotNull public java.lang.String retrieveSourceCode(@NotNull BuildContext buildContext, @Nullable java.lang.String vcsRevisionKey, @NotNull java.io.File sourceDirectory, int depth) throws RepositoryException
retrieveSourceCode
in interface BranchMergingAwareRepository
vcsRevisionKey
- - may be null if you want latest codesourceDirectory
- - directory to checkout todepth
- - how many historical revisions we'd like to check out (-1 means all revisions)
RepositoryException
public boolean mergeWorkspaceWith(@NotNull BuildContext buildContext, @NotNull java.io.File workspace, @NotNull java.lang.String targetRevision) throws RepositoryException
BranchMergingAwareRepository
mergeWorkspaceWith
in interface BranchMergingAwareRepository
buildContext
- the build context of build doing the mergeworkspace
- the workspace to use for mergetargetRevision
- the revision to merge with
RepositoryException
public boolean isMergingSupported()
isMergingSupported
in interface BranchMergingAwareRepository
public java.util.Set<Requirement> getRequirements()
getRequirements
in interface RequirementsAwareRepository
public void addDefaultValues(@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePlugin
RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
addDefaultValues
in interface BuildConfigurationAwarePlugin
addDefaultValues
in class AbstractRepository
buildConfiguration
- - @NotNullpublic void prepareConfigObject(@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePlugin
prepareConfigObject
in interface BuildConfigurationAwarePlugin
prepareConfigObject
in class BaseBuildConfigurationAwarePlugin
buildConfiguration
- - @NotNullpublic void populateFromConfig(@NotNull org.apache.commons.configuration.HierarchicalConfiguration config)
ConvertibleFromConfig
HierarchicalConfiguration
populateFromConfig
in interface ConvertibleFromConfig
populateFromConfig
in class AbstractRepository
@NotNull public org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
ConvertibleFromConfig
HierarchicalConfiguration
from the current state of the object
toConfiguration
in interface ConvertibleFromConfig
toConfiguration
in class AbstractRepository
HierarchicalConfiguration
. Never null@NotNull public java.util.Map<java.lang.String,java.lang.String> getCustomVariables()
CustomVariableProviderRepository
Null values will be filtered out so it's safe to put them in the map.
getCustomVariables
in interface CustomVariableProviderRepository
@NotNull public ErrorCollection validate(@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePlugin
BuildConfiguration
object. The name of the properties match those passed
in through the form fragments in RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
template.
validate
in interface BuildConfigurationAwarePlugin
validate
in class AbstractRepository
buildConfiguration
- - @NotNull
ErrorCollection
keyed by the field name. @NotNull@NotNull public MavenPomAccessor getMavenPomAccessor()
getMavenPomAccessor
in interface MavenPomAccessorCapableRepository
protected boolean isWorkspaceEmpty(java.io.File sourceCodeDirectory)
isWorkspaceEmpty
in class AbstractRepository
@NotNull public java.lang.String getHandlerDescription()
CacheHandler
This should include information about any non-obvious details like scheduling remote agent operations.
getHandlerDescription
in interface CacheHandler
@NotNull public java.util.Collection<CacheDescription> getCacheDescriptions()
CacheHandler
getCacheDescriptions
in interface CacheHandler
public void deleteCaches(@NotNull java.util.Collection<java.lang.String> keys, @NotNull com.opensymphony.xwork.ValidationAware feedback)
CacheHandler
deleteCaches
in interface CacheHandler
keys
- keys from CacheDescription.getKey()
feedback
- consumer of UI messagespublic void deleteUnusedCaches(@NotNull com.opensymphony.xwork.ValidationAware feedback)
CacheHandler
It's the responsibility of the implementing class to figure out which caches are currently unused and optionally delete such caches on remote agents.
deleteUnusedCaches
in interface CacheHandler
feedback
- consumer of UI messagespublic boolean isHgExecutableSet()
@Nullable public java.lang.String getHgExeCapability()
@Nullable public java.lang.String getSshExeCapability()
public java.lang.String getRepositoryUrl()
public java.lang.String getSubstitutedRepositoryUrl()
public java.lang.String getSubstitutedRepositoryUrl(@Nullable java.lang.String repositoryUrl)
@Nullable public java.net.URI getRemoteUri()
public java.lang.String getSubstitutedBranch()
@Deprecated public java.lang.String getBranch()
methods)
@Deprecated public void setBranch(java.lang.String branch)
methods)
public java.lang.String getUsername()
public java.lang.String getSubstitutedUserName()
public java.lang.String getSubstitutedUserName(@Nullable java.lang.String username)
public void setUsername(java.lang.String username)
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
public boolean getSshCompression()
public int getCommandTimeout()
public void setCommandTimeout(int commandTimeout)
public boolean isVerboseLogs()
public void setVerboseLogs(boolean verboseLogs)
public boolean isNoRepositoryCache()
public void setNoRepositoryCache(boolean noRepositoryCache)
public void setCapabilityContext(CapabilityContext capabilityContext)
public void setHgCacheHandler(HgCacheHandler hgCacheHandler)
public void setSshProxyService(SshProxyService sshProxyService)
@NotNull public java.util.List<AuthenticationType> getAuthenticationTypes()
public java.util.List<Plan> getOtherPlansSharingCache(Plan current)
@NotNull public AuthenticationType getAuthenticationType()
public void setAuthenticationType(AuthenticationType authenticationType)
public void setTextProvider(com.opensymphony.xwork.TextProvider textProvider)
setTextProvider
in class AbstractRepository
public void setRepositoryModuleDesciptor(RepositoryModuleDescriptor repositoryModuleDescriptor)
public java.lang.String getOptionDescription()
public void setBranchIntegrationHelper(BranchIntegrationHelper branchIntegrationHelper)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |