com.atlassian.bamboo.plugins.hg
Class HgRepositoryAccessImpl
java.lang.Object
com.atlassian.bamboo.plugins.hg.HgRepositoryAccessImpl
- All Implemented Interfaces:
- HgRepositoryAccess
@NotThreadSafe
public class HgRepositoryAccessImpl
- extends java.lang.Object
- implements HgRepositoryAccess
Method Summary |
void |
archiveSourceCode(java.io.File destinationDirectory,
java.io.File cacheDirectory,
java.lang.String vcsRevision,
java.lang.String[] includePattern)
"Archive" (as in svn export) contents of specified revision, applying specified --include pattern |
void |
close()
Cleans up resources, connections, etc... |
BuildChanges |
collectChangesSinceLastBuild(java.io.File cacheDirectory,
java.lang.String lastVcsRevisionKey,
boolean pullAndCollect)
Checks whether remote repository has newer revision(s). |
java.lang.String |
retrieveSourceCode(java.io.File sourceDirectory,
java.io.File cacheDirectory,
java.lang.String previousRevision,
java.lang.String vcsRevision,
BuildChanges collectedChangesetsReceiver)
Updates sources in sourceDirectory from remote repository to targetRevision. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_SSH_COMMAND
public static final java.lang.String DEFAULT_SSH_COMMAND
- See Also:
- Constant Field Values
HgRepositoryAccessImpl
public HgRepositoryAccessImpl(com.opensymphony.xwork.TextProvider textProvider,
BuildLogger buildLogger,
HgRepository repository)
throws RepositoryException
- Throws:
RepositoryException
collectChangesSinceLastBuild
public BuildChanges collectChangesSinceLastBuild(@NotNull
java.io.File cacheDirectory,
@Nullable
java.lang.String lastVcsRevisionKey,
boolean pullAndCollect)
throws RepositoryException
- Description copied from interface:
HgRepositoryAccess
- Checks whether remote repository has newer revision(s). If pullAndCollect is true then updates
local cache directory and returns changesets since last checked revision
- Specified by:
collectChangesSinceLastBuild
in interface HgRepositoryAccess
- Parameters:
cacheDirectory
- specifies where to store updated repository. Perfectly it should be the 'cache' directory
holding shared repository for all plans using the same repository URLlastVcsRevisionKey
- specifies since which revision we want to collect changesetspullAndCollect
- tells whether we want to obtain full changeset list (slow, requires to pull repository contents) or whether
we're interested only in change detection (fast, but doesn't return real changeset list)
- Returns:
- BuildChanges object which will have filled vcsRevisionKey with newest revision from remote repository. If pullAndCollect is
true then BuildChanges will have filled changes with repository changesets between previousRevision and newest revision
- Throws:
RepositoryException
retrieveSourceCode
public java.lang.String retrieveSourceCode(@NotNull
java.io.File sourceDirectory,
@NotNull
java.io.File cacheDirectory,
@Nullable
java.lang.String previousRevision,
@Nullable
java.lang.String vcsRevision,
@Nullable
BuildChanges collectedChangesetsReceiver)
throws RepositoryException
- Description copied from interface:
HgRepositoryAccess
- Updates sources in sourceDirectory from remote repository to targetRevision. Extracts changesets since previousRevision and stores them
in collectedChangesetsReceiver
- Specified by:
retrieveSourceCode
in interface HgRepositoryAccess
- Parameters:
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.previousRevision
- specifies since which revision we want to collect changesetsvcsRevision
- specifies revision to which we want to updatecollectedChangesetsReceiver
- specifies where we want to store collected changesets. Might be null
- Returns:
- targetRevision
- Throws:
RepositoryException
archiveSourceCode
public void archiveSourceCode(@NotNull
java.io.File destinationDirectory,
@NotNull
java.io.File cacheDirectory,
@Nullable
java.lang.String vcsRevision,
@Nullable
java.lang.String[] includePattern)
throws RepositoryException
- Description copied from interface:
HgRepositoryAccess
- "Archive" (as in svn export) contents of specified revision, applying specified --include pattern
Differs from {link #retrieveSourceCode} by not cloning the repository first (think "svn checkout" vs. "svn export")
- Specified by:
archiveSourceCode
in interface HgRepositoryAccess
- Parameters:
destinationDirectory
- directory to extract files tocacheDirectory
- local repository to extract fromvcsRevision
- revision to extract, tip if nullincludePattern
- include patterns to limit extracted files, all files if null or empty
- Throws:
RepositoryException
- on any error
close
public void close()
- Description copied from interface:
HgRepositoryAccess
- Cleans up resources, connections, etc...
- Specified by:
close
in interface HgRepositoryAccess
Copyright © 2010 Atlassian. All Rights Reserved.