com.atlassian.bamboo.plugins.hg
Class HgRepository

java.lang.Object
  extended by com.atlassian.bamboo.repository.AbstractRepository
      extended by com.atlassian.bamboo.plugins.hg.HgRepository
All Implemented Interfaces:
ConvertibleFromConfig, InitablePluginModule, CleanCheckoutAwareRepository, CleanWorkingDirectoryAwareRepository, IncludeExcludeAwareRepository, MavenPomAccessorCapableRepository, Repository, DescriptionProvider, NameProvider, BambooPluginModule, BuildConfigurationAwarePlugin, ConfigurablePlugin, PostConfigurableRepository, RepositoryV2, java.io.Serializable

public class HgRepository
extends AbstractRepository
implements PostConfigurableRepository, MavenPomAccessorCapableRepository

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.atlassian.bamboo.repository.AbstractRepository
BUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, CLEAN_CHECKOUT_PARAM, CLEAN_WORKING_DIRECTORY_PARAM, repositoryModuleDescriptor, templateRenderer, textProvider, variableSubstitutionBean
 
Fields inherited from interface com.atlassian.bamboo.repository.Repository
SELECTED_REPOSITORY, UNKNOWN_HOST
 
Fields inherited from interface com.atlassian.bamboo.repository.IncludeExcludeAwareRepository
FILTER_PATTERN_EXCLUDE, FILTER_PATTERN_INCLUDE, FILTER_PATTERN_OPTION, FILTER_PATTERN_REGEX
 
Constructor Summary
HgRepository()
           
 
Method Summary
 void addDefaultValues(BuildConfiguration buildConfiguration)
          Extension point for adding default values to the form for BuildConfigurationAwarePlugin.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
 BuildChanges collectChangesSinceLastBuild(java.lang.String planKey, java.lang.String lastVcsRevisionKey)
          Collects the changes since the lastVcsRevisionKey
 AuthenticationType getAuthenticationType()
           
 java.util.List<AuthenticationType> getAuthenticationTypes()
           
 java.lang.String getBranch()
           
 java.io.File getCacheDirectory()
           
static java.io.File getCacheDirectory(java.io.File workingDirectory, java.lang.String repositoryUrl, java.lang.String username)
           
 int getCommandTimeout()
           
 java.lang.String getHgExeCapability()
           
 java.lang.String getHost()
          What's the repository server host
 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.lang.String getPassword()
           
 java.net.URI getRemoteUri()
           
 java.lang.String getRepositoryUrl()
           
 java.lang.String getSshExeCapability()
           
 java.lang.String getUsername()
           
 boolean isCleanCacheDirectory()
           
 boolean isDelayChangesetDetection()
           
 boolean isHgExecutableSet()
          For configuration screens
 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)
           
 void performPostConfiguration(BuildConfiguration buildConfiguration, Plan plan)
          Allows any other configuration to be performed after another repository has been created.
 void performPostConfigurationForSelectedRepository(BuildConfiguration buildConfiguration, Plan plan)
          Allows any other configuration to be performed after this repository has been created
 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.
 java.lang.String retrieveSourceCode(BuildContext buildContext, java.lang.String vcsRevision)
          Checks out the latest source code to an appropriate repository
 java.lang.String retrieveSourceCode(java.lang.String planKey, java.lang.String vcsRevisionKey)
          Checks out the latest source code to an appropriate repository
 void setCapabilityContext(CapabilityContext capabilityContext)
           
 void setPlanManager(PlanManager planManager)
           
 void setTextProvider(com.opensymphony.xwork.TextProvider textProvider)
           
 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.AbstractRepository
checkConnection, createStringFromList, customizeBuildRequirements, getDescription, getEditHtml, getFilterFilePatternOption, getFilterFilePatternRegex, getKey, getMavenPomCheckoutAccessEditHtml, getMinimalEditHtml, getShortKey, getSourceCodeDirectory, getTriggerIpAddress, getVariableSubstitutionBean, getViewHtml, getWorkingDirectory, init, isCleanCheckout, isCleanWorkingDirectory, referencesDifferentRepository, removeBuildRequirements, setBuildDirectoryManager, setBuildLoggerManager, setCleanCheckout, setCleanWorkingDirectory, setFilterFilePatternOption, setFilterFilePatternRegex, setReferencesDifferentRepository, setTemplateRenderer, setTriggerIpAddress, setVariableSubstitutionBean, setWorkingDir
 
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.Repository
checkConnection, getKey, getMinimalEditHtml, getShortKey, getTriggerIpAddress, setReferencesDifferentRepository
 
Methods inherited from interface com.atlassian.bamboo.v2.build.repository.RepositoryV2
getSourceCodeDirectory, referencesDifferentRepository
 
Methods inherited from interface com.atlassian.bamboo.v2.build.ConfigurablePlugin
customizeBuildRequirements, removeBuildRequirements
 
Methods inherited from interface com.atlassian.bamboo.v2.build.BuildConfigurationAwarePlugin
getEditHtml, getViewHtml
 
Methods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider
getDescription
 

Constructor Detail

HgRepository

public HgRepository()
Method Detail

getName

@NotNull
public java.lang.String getName()
Description copied from interface: Repository
The display name for the repository type

Specified by:
getName in interface Repository
Specified by:
getName in interface DescriptionProvider
Specified by:
getName in interface NameProvider

getHost

public java.lang.String getHost()
Description copied from interface: Repository
What's the repository server host

Specified by:
getHost in interface Repository
Returns:
The host!

getLocationIdentifier

@NotNull
public java.lang.String getLocationIdentifier()
Description copied from interface: Repository
A string representing the location of the repository

Specified by:
getLocationIdentifier in interface Repository
Overrides:
getLocationIdentifier in class AbstractRepository
Returns:

isRepositoryDifferent

public boolean isRepositoryDifferent(@NotNull
                                     Repository repository)
Description copied from interface: RepositoryV2
Checks if the current repo is the same as the given repository

Specified by:
isRepositoryDifferent in interface RepositoryV2
Parameters:
repository - to compare against
Returns:
true of repositories are different, false if the same;

getCacheDirectory

public java.io.File getCacheDirectory()
                               throws RepositoryException
Throws:
RepositoryException

getCacheDirectory

public static java.io.File getCacheDirectory(java.io.File workingDirectory,
                                             java.lang.String repositoryUrl,
                                             java.lang.String username)
                                      throws RepositoryException
Throws:
RepositoryException

collectChangesSinceLastBuild

@NotNull
public BuildChanges collectChangesSinceLastBuild(@NotNull
                                                         java.lang.String planKey,
                                                         @Nullable
                                                         java.lang.String lastVcsRevisionKey)
                                          throws RepositoryException
Description copied from interface: RepositoryV2
Collects the changes since the lastVcsRevisionKey

Specified by:
collectChangesSinceLastBuild in interface RepositoryV2
lastVcsRevisionKey - - can be null, if null you should ensure the correct vcsrevisionkey is returned in the BuildChanges object.
Returns:
A build changes object with the appropriate build changes
Throws:
RepositoryException - if something goes wrong

retrieveSourceCode

@NotNull
public java.lang.String retrieveSourceCode(@NotNull
                                                   BuildContext buildContext,
                                                   @Nullable
                                                   java.lang.String vcsRevision)
                                    throws RepositoryException
Description copied from interface: RepositoryV2
Checks out the latest source code to an appropriate repository

Specified by:
retrieveSourceCode in interface RepositoryV2
vcsRevision - - may be null if you want latest code
Returns:
vcsRevisionKey - the revision
Throws:
RepositoryException

performPostConfiguration

public void performPostConfiguration(BuildConfiguration buildConfiguration,
                                     Plan plan)
Description copied from interface: PostConfigurableRepository
Allows any other configuration to be performed after another repository has been created.

Specified by:
performPostConfiguration in interface PostConfigurableRepository

performPostConfigurationForSelectedRepository

public void performPostConfigurationForSelectedRepository(BuildConfiguration buildConfiguration,
                                                          Plan plan)
Description copied from interface: PostConfigurableRepository
Allows any other configuration to be performed after this repository has been created

Specified by:
performPostConfigurationForSelectedRepository in interface PostConfigurableRepository

retrieveSourceCode

@NotNull
public java.lang.String retrieveSourceCode(@NotNull
                                                   java.lang.String planKey,
                                                   @Nullable
                                                   java.lang.String vcsRevisionKey)
                                    throws RepositoryException
Description copied from interface: RepositoryV2
Checks out the latest source code to an appropriate repository

Specified by:
retrieveSourceCode in interface RepositoryV2
vcsRevisionKey - - may be null if you want latest code
Returns:
vcsRevisionKey - the revision
Throws:
RepositoryException

addDefaultValues

public void addDefaultValues(@NotNull
                             BuildConfiguration buildConfiguration)
Description copied from interface: BuildConfigurationAwarePlugin
Extension point for adding default values to the form for BuildConfigurationAwarePlugin.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)

Specified by:
addDefaultValues in interface BuildConfigurationAwarePlugin
Overrides:
addDefaultValues in class AbstractRepository
Parameters:
buildConfiguration - - @NotNull

prepareConfigObject

public void prepareConfigObject(@NotNull
                                BuildConfiguration buildConfiguration)
Description copied from interface: BuildConfigurationAwarePlugin
Do any preprocessing work before validation occurs. For repository, builder and web repository plugins this will only be called if the plugin is select by the user.

Specified by:
prepareConfigObject in interface BuildConfigurationAwarePlugin
Parameters:
buildConfiguration - - @NotNull

populateFromConfig

public void populateFromConfig(@NotNull
                               org.apache.commons.configuration.HierarchicalConfiguration config)
Description copied from interface: ConvertibleFromConfig
Update the current object with data in the HierarchicalConfiguration

Specified by:
populateFromConfig in interface ConvertibleFromConfig
Overrides:
populateFromConfig in class AbstractRepository

toConfiguration

@NotNull
public org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
Description copied from interface: ConvertibleFromConfig
Generate a HierarchicalConfiguration from the current state of the object

Specified by:
toConfiguration in interface ConvertibleFromConfig
Overrides:
toConfiguration in class AbstractRepository
Returns:
Always returns an HierarchicalConfiguration. Never null

validate

@NotNull
public ErrorCollection validate(@NotNull
                                        BuildConfiguration buildConfiguration)
Description copied from interface: BuildConfigurationAwarePlugin
Validates the properties in the BuildConfiguration object. The name of the properties match those passed in through the form fragments in BuildConfigurationAwarePlugin.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) template.

Specified by:
validate in interface BuildConfigurationAwarePlugin
Overrides:
validate in class AbstractRepository
Parameters:
buildConfiguration - - @NotNull
Returns:
ErrorCollection keyed by the field name. @NotNull

getMavenPomAccessor

@NotNull
public MavenPomAccessor getMavenPomAccessor()
Specified by:
getMavenPomAccessor in interface MavenPomAccessorCapableRepository

isWorkspaceEmpty

protected boolean isWorkspaceEmpty(java.io.File sourceCodeDirectory)
Overrides:
isWorkspaceEmpty in class AbstractRepository

isHgExecutableSet

public boolean isHgExecutableSet()
For configuration screens

Returns:
true if mercurial capability is set

getHgExeCapability

@Nullable
public java.lang.String getHgExeCapability()

getSshExeCapability

@Nullable
public java.lang.String getSshExeCapability()

getRepositoryUrl

public java.lang.String getRepositoryUrl()

getRemoteUri

@Nullable
public java.net.URI getRemoteUri()

getBranch

public java.lang.String getBranch()

getUsername

public java.lang.String getUsername()

getPassword

public java.lang.String getPassword()

getCommandTimeout

public int getCommandTimeout()

isDelayChangesetDetection

public boolean isDelayChangesetDetection()

isCleanCacheDirectory

public boolean isCleanCacheDirectory()

isVerboseLogs

public boolean isVerboseLogs()

setCapabilityContext

public void setCapabilityContext(CapabilityContext capabilityContext)

setPlanManager

public void setPlanManager(PlanManager planManager)

getAuthenticationTypes

@NotNull
public java.util.List<AuthenticationType> getAuthenticationTypes()

getAuthenticationType

@NotNull
public AuthenticationType getAuthenticationType()

setTextProvider

public void setTextProvider(com.opensymphony.xwork.TextProvider textProvider)
Overrides:
setTextProvider in class AbstractRepository


Copyright © 2010 Atlassian. All Rights Reserved.