Search in sources :

Example 6 with CommitInfo

use of jetbrains.vcs.api.CommitInfo 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

GitCommitsInfoBuilder (jetbrains.buildServer.buildTriggers.vcs.git.commitInfo.GitCommitsInfoBuilder)6 CommitInfo (jetbrains.vcs.api.CommitInfo)6 GitFetchService (jetbrains.buildServer.buildTriggers.vcs.git.GitFetchService)5 GitVcsSupport (jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport)5 Test (org.testng.annotations.Test)4 ArrayList (java.util.ArrayList)1 BulkPatchBuilderRequest (jetbrains.buildServer.vcs.BulkPatchService.BulkPatchBuilderRequest)1 CommitsInfoBuilder (jetbrains.buildServer.vcs.CommitsInfoBuilder)1 VcsRootImpl (jetbrains.buildServer.vcs.impl.VcsRootImpl)1 CommitMountPointInfo (jetbrains.vcs.api.CommitMountPointInfo)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1