com.atlassian.bamboo.plugins.hg
Interface HgRepositoryAccess

All Known Implementing Classes:
HgRepositoryAccessImpl

public interface HgRepositoryAccess


Method Summary
 void archiveSourceCode(java.io.File destinationDirectory, java.io.File cacheDirectory, java.lang.String revision, java.lang.String[] includePattern)
          "Archive" (as in svn export) contents of specified revision, applying specified --include pattern
 void close()
          Cleans up resources, connections, etc...
 BuildRepositoryChanges collectChangesSinceLastBuild(java.io.File cacheDirectory, java.lang.String previousRevision)
          Checks whether remote repository has newer revision(s).
 CommitContext getFirstCommit(java.io.File cacheDirectory)
           
 CommitContext getLastCommit(java.io.File cacheDirectory)
           
 java.lang.String retrieveSourceCode(java.io.File sourceDirectory, java.io.File cacheDirectory, java.lang.String targetRevision)
          Updates sources in sourceDirectory from remote repository to targetRevision.
 

Method Detail

collectChangesSinceLastBuild

BuildRepositoryChanges collectChangesSinceLastBuild(@NotNull
                                                    java.io.File cacheDirectory,
                                                    @Nullable
                                                    java.lang.String previousRevision)
                                                    throws RepositoryException
Checks whether remote repository has newer revision(s). If pullAndCollect is true then updates local cache directory and returns changesets since last checked revision

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 URL
previousRevision - specifies since which revision we want to collect changesets
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

java.lang.String retrieveSourceCode(@NotNull
                                    java.io.File sourceDirectory,
                                    @Nullable
                                    java.io.File cacheDirectory,
                                    @Nullable
                                    java.lang.String targetRevision)
                                    throws RepositoryException
Updates sources in sourceDirectory from remote repository to targetRevision. Extracts changesets since previousRevision and stores them in collectedChangesetsReceiver. If cacheDirectory is not null it will use it as a mid-repository. Otherwise will pull from remote repository directly.

Parameters:
sourceDirectory - specifies where we want to retrieve sources
cacheDirectory - 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 changesets
Returns:
targetRevision
Throws:
RepositoryException

archiveSourceCode

void archiveSourceCode(@NotNull
                       java.io.File destinationDirectory,
                       @NotNull
                       java.io.File cacheDirectory,
                       @NotNull
                       java.lang.String revision,
                       @Nullable
                       java.lang.String[] includePattern)
                       throws RepositoryException
"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")

Parameters:
destinationDirectory - directory to extract files to
cacheDirectory - local repository to extract from
revision - revision to extract, tip if null
includePattern - include patterns to limit extracted files, all files if null or empty
Throws:
RepositoryException - on any error

close

void close()
Cleans up resources, connections, etc...


getLastCommit

@Nullable
CommitContext getLastCommit(@NotNull
                                     java.io.File cacheDirectory)
                            throws RepositoryException
Throws:
RepositoryException

getFirstCommit

@Nullable
CommitContext getFirstCommit(@NotNull
                                      java.io.File cacheDirectory)
                             throws RepositoryException
Throws:
RepositoryException


Copyright © 2012 Atlassian. All Rights Reserved.