public interface HgRepositoryAccess
Modifier and Type | Method and Description |
---|---|
void |
archiveSourceCode(File destinationDirectory,
File cacheDirectory,
String revision,
String[] includePattern)
"Archive" (as in svn export) contents of specified revision, applying specified --include pattern
|
void |
close()
Cleans up resources, connections, etc...
|
BuildRepositoryChanges |
collectChangesSinceLastBuild(File cacheDirectory,
String previousRevision,
int maxCommitsToReturn)
Checks whether remote repository has newer revision(s).
|
CommitContext |
getFirstCommit(File cacheDirectory) |
CommitContext |
getLastCommit(File cacheDirectory) |
String |
getLatestRemoteRevisionHash(File workingDirectory)
Returns the latest 40-character hash code of the tip-most change set in remote repository.
|
String |
retrieveSourceCode(File sourceDirectory,
File cacheDirectory,
String targetRevision)
Updates sources in sourceDirectory from remote repository to targetRevision.
|
BuildRepositoryChanges collectChangesSinceLastBuild(@NotNull File cacheDirectory, @Nullable String previousRevision, int maxCommitsToReturn) throws RepositoryException
cacheDirectory
- specifies where to store updated repository. Perfectly it should be the 'cache' directory
holding shared repository for all plans using the same repository URLpreviousRevision
- specifies since which revision we want to collect changesetsmaxCommitsToReturn
- RepositoryException
String retrieveSourceCode(@NotNull File sourceDirectory, @Nullable File cacheDirectory, @Nullable String targetRevision) throws RepositoryException
sourceDirectory
- specifies where we want to retrieve sourcescacheDirectory
- specifies where is kept local cache directory, which will hold presumably a more updated repository than sourceDirectory.targetRevision
- specifies since which revision we want to collect changesetsRepositoryException
void archiveSourceCode(@NotNull File destinationDirectory, @NotNull File cacheDirectory, @NotNull String revision, @Nullable String[] includePattern) throws RepositoryException
Differs from {link #retrieveSourceCode} by not cloning the repository first (think "svn checkout" vs. "svn export")
destinationDirectory
- directory to extract files tocacheDirectory
- local repository to extract fromrevision
- revision to extract, tip if nullincludePattern
- include patterns to limit extracted files, all files if null or emptyRepositoryException
- on any errorvoid close()
@Nullable CommitContext getLastCommit(@NotNull File cacheDirectory) throws RepositoryException
RepositoryException
@NotNull CommitContext getFirstCommit(@NotNull File cacheDirectory) throws RepositoryException
RepositoryException
@NotNull String getLatestRemoteRevisionHash(@NotNull File workingDirectory) throws RepositoryException
workingDirectory
- working directory to execute commandRepositoryException
- on any errorCopyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.