Search in sources :

Example 6 with GitFetchService

use of jetbrains.buildServer.buildTriggers.vcs.git.GitFetchService in project teamcity-git by JetBrains.

the class GitCommitsInfoBuilderTest method test_torrents_repo_local.

@Test(enabled = false)
public void test_torrents_repo_local() throws VcsException {
    // /does not work for real repository: Fetcher call is mostly endless
    VcsRoot root = vcsRoot().withFetchUrl("E:\\Work\\TeamCity\\trunk\\teamcity-torrent-plugin\\.git").withRepositoryPathOnServer("E:\\Work\\TeamCity\\trunk\\teamcity-torrent-plugin\\.git").withBranch("master").build();
    GitVcsSupport vcs = gitSupport().withServerPaths(myServerPaths).build();
    final List<CommitInfo> commits = new ArrayList<CommitInfo>();
    new GitCommitsInfoBuilder(vcs, new GitFetchService(vcs)).collectCommits(root, CheckoutRules.DEFAULT, new CommitsInfoBuilder.CommitsConsumer() {

        public void consumeCommit(@NotNull CommitInfo commit) {
            commits.add(commit);
        }
    });
    System.out.println("Total commits: " + commits.size());
}
Also used : GitVcsSupport(jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport) GitCommitsInfoBuilder(jetbrains.buildServer.buildTriggers.vcs.git.commitInfo.GitCommitsInfoBuilder) GitCommitsInfoBuilder(jetbrains.buildServer.buildTriggers.vcs.git.commitInfo.GitCommitsInfoBuilder) CommitInfo(jetbrains.vcs.api.CommitInfo) GitFetchService(jetbrains.buildServer.buildTriggers.vcs.git.GitFetchService) Test(org.testng.annotations.Test)

Example 7 with GitFetchService

use of jetbrains.buildServer.buildTriggers.vcs.git.GitFetchService in project teamcity-git by JetBrains.

the class GitCommitsInfoBuilderTest method test_linux.

@Test(enabled = false)
public void test_linux() throws VcsException {
    // /does not work for real repository: Fetcher call is mostly endless
    VcsRoot root = vcsRoot().withFetchUrl("F:\\Work\\linux\\.git").withRepositoryPathOnServer("F:\\Work\\linux\\.git").withBranch("master").build();
    GitVcsSupport vcs = gitSupport().withServerPaths(myServerPaths).build();
    final List<CommitInfo> commits = new ArrayList<CommitInfo>();
    new GitCommitsInfoBuilder(vcs, new GitFetchService(vcs)).collectCommits(root, CheckoutRules.DEFAULT, new CommitsInfoBuilder.CommitsConsumer() {

        public void consumeCommit(@NotNull CommitInfo commit) {
            commits.add(commit);
        }
    });
    System.out.println("Total commits: " + commits.size());
}
Also used : GitVcsSupport(jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport) GitCommitsInfoBuilder(jetbrains.buildServer.buildTriggers.vcs.git.commitInfo.GitCommitsInfoBuilder) GitCommitsInfoBuilder(jetbrains.buildServer.buildTriggers.vcs.git.commitInfo.GitCommitsInfoBuilder) CommitInfo(jetbrains.vcs.api.CommitInfo) GitFetchService(jetbrains.buildServer.buildTriggers.vcs.git.GitFetchService) Test(org.testng.annotations.Test)

Aggregations

GitFetchService (jetbrains.buildServer.buildTriggers.vcs.git.GitFetchService)7 GitVcsSupport (jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport)6 GitCommitsInfoBuilder (jetbrains.buildServer.buildTriggers.vcs.git.commitInfo.GitCommitsInfoBuilder)6 CommitInfo (jetbrains.vcs.api.CommitInfo)5 Test (org.testng.annotations.Test)4 VcsRootImpl (jetbrains.buildServer.vcs.impl.VcsRootImpl)2 File (java.io.File)1 OperationContext (jetbrains.buildServer.buildTriggers.vcs.git.OperationContext)1 BulkPatchBuilderImpl (jetbrains.buildServer.buildTriggers.vcs.git.patch.BulkPatchBuilderImpl)1 GitTestUtil.dataFile (jetbrains.buildServer.buildTriggers.vcs.git.tests.GitTestUtil.dataFile)1 ServerPaths (jetbrains.buildServer.serverSide.ServerPaths)1 CommitMountPointInfo (jetbrains.vcs.api.CommitMountPointInfo)1 BeforeMethod (org.testng.annotations.BeforeMethod)1