public class GitWorkingCopyManager extends AbstractGitExecutor implements MergingVcsWorkingCopyManager, UpdatingVcsWorkingCopyManager, NoContextVcsWorkingCopyManager, StatusProvidingVcsWorkingCopyManager, VcsExecutorWithRequirements
buildDirectoryManager, buildLoggingContext, customVariableContext, DEFAULT_BRANCH, i18nResolver, sshProxyService, trustedKeyHelper| Constructor and Description |
|---|
GitWorkingCopyManager(CapabilityContext capabilityContext,
CredentialsAccessor credentialsAccessor,
CustomVariableContext customVariableContext,
BuildDirectoryManager buildDirectoryManager,
com.atlassian.sal.api.message.I18nResolver i18nResolver,
TrustedKeyHelper trustedKeyHelper,
SshProxyService sshProxyService,
AgentContext agentContext,
BuildLoggerManager buildLoggerManager,
VcsBranchIntegrationHelper branchIntegrationHelper,
BuildLoggingContext buildLoggingContext) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull VcsWorkingCopy |
checkoutAndMerge(@NotNull CommonContext commonContext,
@NotNull VcsRepositoryData vcsRepositoryData,
@NotNull VcsBranch targetBranch,
@NotNull PlanVcsRevisionData revisionOnTarget,
@NotNull VcsBranch sourceBranch,
@NotNull PlanVcsRevisionData sourceRevision,
@NotNull File targetPath)
Checks out the targetBranch and merges sourceBranch to it.
|
@NotNull VcsWorkingCopy |
commitLocal(@NotNull VcsWorkingCopy workingCopy,
@NotNull VcsRepositoryData vcsRepositoryData,
@NotNull String commitMessage)
Create a local commit.
|
@NotNull Set<Requirement> |
getRequirements(@NotNull VcsRepositoryData vcsRepositoryData) |
@NotNull VcsWorkingCopy |
getWorkingCopyInfo(@NotNull VcsRepositoryData repositoryData,
@NotNull File checkoutPath)
Provide repository working copy information for the given checkout path.
|
@NotNull VcsWorkingCopy |
retrieveSourceCode(@NotNull CommonContext commonContext,
@NotNull VcsRepositoryData repositoryData,
@NotNull PlanVcsRevisionData targetRevision,
@NotNull File targetPath)
Checkout or update a working copy to a revision.
|
void |
stageChanges(@NotNull VcsWorkingCopy workingCopy,
@NotNull VcsRepositoryData repositoryData,
@NotNull Collection<String> pathsToAdd)
Stage changes for committing.
|
@NotNull VcsWorkingCopy |
updateRemote(@NotNull VcsWorkingCopy workingCopy,
@NotNull VcsRepositoryData vcsRepositoryData,
@Nullable String commitMessage)
Update remote repository.
|
@NotNull VcsWorkingCopy |
updateToLatestRevision(@NotNull CommonContext commonContext,
@NotNull VcsRepositoryData repositoryData,
@NotNull File targetPath)
Checkout or update a working copy to the latest revision.
|
@NotNull VcsWorkingCopy |
updateToLatestRevision(@NotNull VcsRepositoryData repositoryData,
@NotNull File targetPath)
Checkout or update a working copy to the latest revision.
|
fetchCacheWithRetry, fetchWithRetry, getAccessData, getCacheDirectory, getCachePath, getGitCapability, getSharedCredentialsIdField, getSshCapability, getSubstitutedAccessData, getSubstitutedAccessDataBuilder, getWorkingDirectory, isUsingSharedCredentials, rethrowOrRemoveDirectory, substituteStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanDoMerge, getMergingRequirements@Inject public GitWorkingCopyManager(CapabilityContext capabilityContext, CredentialsAccessor credentialsAccessor, CustomVariableContext customVariableContext, BuildDirectoryManager buildDirectoryManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, TrustedKeyHelper trustedKeyHelper, SshProxyService sshProxyService, AgentContext agentContext, BuildLoggerManager buildLoggerManager, VcsBranchIntegrationHelper branchIntegrationHelper, BuildLoggingContext buildLoggingContext)
@NotNull public @NotNull VcsWorkingCopy getWorkingCopyInfo(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull File checkoutPath) throws RepositoryException
StatusProvidingVcsWorkingCopyManagergetWorkingCopyInfo in interface StatusProvidingVcsWorkingCopyManagerrepositoryData - configuration of the repositorycheckoutPath - path, where repository was checked outRepositoryException - if any error occurs, or e.g. the path is not a valid checkout path for the
repository@NotNull public @NotNull Set<Requirement> getRequirements(@NotNull @NotNull VcsRepositoryData vcsRepositoryData)
getRequirements in interface VcsExecutorWithRequirements@NotNull public @NotNull VcsWorkingCopy retrieveSourceCode(@NotNull @NotNull CommonContext commonContext, @NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull PlanVcsRevisionData targetRevision, @NotNull @NotNull File targetPath) throws RepositoryException
VcsWorkingCopyManagerretrieveSourceCode in interface VcsWorkingCopyManagercommonContext - - a current build or deployment contextrepositoryData - - configuration of a repository to checkout/updatetargetRevision - - revision to check out or update totargetPath - - workings copy's path. Note that some legacy implementation may ignore this parameter. (see FixedDirectoryWorkingCopyManager)RepositoryException@NotNull public @NotNull VcsWorkingCopy updateToLatestRevision(@NotNull @NotNull CommonContext commonContext, @NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull File targetPath) throws RepositoryException
VcsWorkingCopyManagerupdateToLatestRevision in interface VcsWorkingCopyManagercommonContext - - a current build or deployment contextrepositoryData - - configuration of a repository to checkout/updatetargetPath - - workings copy's path. Note that some legacy implementation may ignore this parameter. (see FixedDirectoryWorkingCopyManager)RepositoryException@NotNull public @NotNull VcsWorkingCopy updateToLatestRevision(@NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull File targetPath) throws RepositoryException
NoContextVcsWorkingCopyManagerupdateToLatestRevision in interface NoContextVcsWorkingCopyManagerrepositoryData - - configuration of a repository to checkout/updatetargetPath - - workings copy's path. Note that some legacy implementation may ignore this parameter. (see FixedDirectoryWorkingCopyManager)RepositoryException@NotNull public @NotNull VcsWorkingCopy checkoutAndMerge(@NotNull @NotNull CommonContext commonContext, @NotNull @NotNull VcsRepositoryData vcsRepositoryData, @NotNull @NotNull VcsBranch targetBranch, @NotNull @NotNull PlanVcsRevisionData revisionOnTarget, @NotNull @NotNull VcsBranch sourceBranch, @NotNull @NotNull PlanVcsRevisionData sourceRevision, @NotNull @NotNull File targetPath) throws RepositoryException
MergingVcsWorkingCopyManagercheckoutAndMerge in interface MergingVcsWorkingCopyManagervcsRepositoryData - configuration of the repository. Note that the following parameters override branch stored in repository data.targetBranch - - target branch (branch to checkout and merge to)revisionOnTarget - - revision to checkout and merge tosourceBranch - - branch to merge fromsourceRevision - - revision to merge fromtargetPath - - workings copy's pathRepositoryExceptionpublic void stageChanges(@NotNull
@NotNull VcsWorkingCopy workingCopy,
@NotNull
@NotNull VcsRepositoryData repositoryData,
@NotNull
@NotNull Collection<String> pathsToAdd)
throws RepositoryException
UpdatingVcsWorkingCopyManagerStaging logic may differ between repository types.
stageChanges in interface UpdatingVcsWorkingCopyManagerworkingCopy - workspace to perform the stagingrepositoryData - configuration of repositorypathsToAdd - paths, relative to working copy directory, to stage for committing; if empty, all modified
files from working copy directory should be stagedRepositoryException@NotNull public @NotNull VcsWorkingCopy commitLocal(@NotNull @NotNull VcsWorkingCopy workingCopy, @NotNull @NotNull VcsRepositoryData vcsRepositoryData, @NotNull @NotNull String commitMessage) throws RepositoryException
UpdatingVcsWorkingCopyManagercommitLocal in interface UpdatingVcsWorkingCopyManagerRepositoryException@NotNull public @NotNull VcsWorkingCopy updateRemote(@NotNull @NotNull VcsWorkingCopy workingCopy, @NotNull @NotNull VcsRepositoryData vcsRepositoryData, @Nullable @Nullable String commitMessage) throws RepositoryException
UpdatingVcsWorkingCopyManagerupdateRemote in interface UpdatingVcsWorkingCopyManagercommitMessage - - implementors are free to ignore this parameter.RepositoryExceptionCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.