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 |
---|---|
VcsWorkingCopy |
checkoutAndMerge(CommonContext commonContext,
VcsRepositoryData vcsRepositoryData,
VcsBranch targetBranch,
PlanVcsRevisionData revisionOnTarget,
VcsBranch sourceBranch,
PlanVcsRevisionData sourceRevision,
File targetPath)
Checks out the targetBranch and merges sourceBranch to it.
|
VcsWorkingCopy |
commitLocal(VcsWorkingCopy workingCopy,
VcsRepositoryData vcsRepositoryData,
String commitMessage)
Create a local commit.
|
Set<Requirement> |
getRequirements(VcsRepositoryData vcsRepositoryData) |
VcsWorkingCopy |
getWorkingCopyInfo(VcsRepositoryData repositoryData,
File checkoutPath)
Provide repository working copy information for the given checkout path.
|
VcsWorkingCopy |
retrieveSourceCode(CommonContext commonContext,
VcsRepositoryData repositoryData,
PlanVcsRevisionData targetRevision,
File targetPath)
Checkout or update a working copy to a revision.
|
void |
stageChanges(VcsWorkingCopy workingCopy,
VcsRepositoryData repositoryData,
Collection<String> pathsToAdd)
Stage changes for committing.
|
VcsWorkingCopy |
updateRemote(VcsWorkingCopy workingCopy,
VcsRepositoryData vcsRepositoryData,
String commitMessage)
Update remote repository.
|
VcsWorkingCopy |
updateToLatestRevision(CommonContext commonContext,
VcsRepositoryData repositoryData,
File targetPath)
Checkout or update a working copy to the latest revision.
|
VcsWorkingCopy |
updateToLatestRevision(VcsRepositoryData repositoryData,
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, substituteString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canDoMerge, 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 VcsWorkingCopy getWorkingCopyInfo(@NotNull VcsRepositoryData repositoryData, @NotNull File checkoutPath) throws RepositoryException
StatusProvidingVcsWorkingCopyManager
getWorkingCopyInfo
in interface StatusProvidingVcsWorkingCopyManager
repositoryData
- 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 Set<Requirement> getRequirements(@NotNull VcsRepositoryData vcsRepositoryData)
getRequirements
in interface VcsExecutorWithRequirements
@NotNull public VcsWorkingCopy retrieveSourceCode(@NotNull CommonContext commonContext, @NotNull VcsRepositoryData repositoryData, @NotNull PlanVcsRevisionData targetRevision, @NotNull File targetPath) throws RepositoryException
VcsWorkingCopyManager
retrieveSourceCode
in interface VcsWorkingCopyManager
commonContext
- - 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 VcsWorkingCopy updateToLatestRevision(@NotNull CommonContext commonContext, @NotNull VcsRepositoryData repositoryData, @NotNull File targetPath) throws RepositoryException
VcsWorkingCopyManager
updateToLatestRevision
in interface VcsWorkingCopyManager
commonContext
- - 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 VcsWorkingCopy updateToLatestRevision(@NotNull VcsRepositoryData repositoryData, @NotNull File targetPath) throws RepositoryException
NoContextVcsWorkingCopyManager
updateToLatestRevision
in interface NoContextVcsWorkingCopyManager
repositoryData
- - 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 VcsWorkingCopy checkoutAndMerge(@NotNull CommonContext commonContext, @NotNull VcsRepositoryData vcsRepositoryData, @NotNull VcsBranch targetBranch, @NotNull PlanVcsRevisionData revisionOnTarget, @NotNull VcsBranch sourceBranch, @NotNull PlanVcsRevisionData sourceRevision, @NotNull File targetPath) throws RepositoryException
MergingVcsWorkingCopyManager
checkoutAndMerge
in interface MergingVcsWorkingCopyManager
vcsRepositoryData
- 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 pathRepositoryException
public void stageChanges(@NotNull VcsWorkingCopy workingCopy, @NotNull VcsRepositoryData repositoryData, @NotNull Collection<String> pathsToAdd) throws RepositoryException
UpdatingVcsWorkingCopyManager
Staging logic may differ between repository types.
stageChanges
in interface UpdatingVcsWorkingCopyManager
workingCopy
- 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 VcsWorkingCopy commitLocal(@NotNull VcsWorkingCopy workingCopy, @NotNull VcsRepositoryData vcsRepositoryData, @NotNull String commitMessage) throws RepositoryException
UpdatingVcsWorkingCopyManager
commitLocal
in interface UpdatingVcsWorkingCopyManager
RepositoryException
@NotNull public VcsWorkingCopy updateRemote(@NotNull VcsWorkingCopy workingCopy, @NotNull VcsRepositoryData vcsRepositoryData, @Nullable String commitMessage) throws RepositoryException
UpdatingVcsWorkingCopyManager
updateRemote
in interface UpdatingVcsWorkingCopyManager
commitMessage
- - implementors are free to ignore this parameter.RepositoryException
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.