Search in sources :

Example 31 with GitVcsSupport

use of jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport 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

GitVcsSupport (jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport)31 VcsRoot (jetbrains.buildServer.vcs.VcsRoot)15 CheckoutRules (jetbrains.buildServer.vcs.CheckoutRules)10 Test (org.testng.annotations.Test)9 GitFetchService (jetbrains.buildServer.buildTriggers.vcs.git.GitFetchService)6 GitCommitsInfoBuilder (jetbrains.buildServer.buildTriggers.vcs.git.commitInfo.GitCommitsInfoBuilder)5 CommitInfo (jetbrains.vcs.api.CommitInfo)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 PatchBuilderImpl (jetbrains.buildServer.vcs.patches.PatchBuilderImpl)3 File (java.io.File)2 VcsRootImpl (jetbrains.buildServer.vcs.impl.VcsRootImpl)2 HashSet (java.util.HashSet)1 OperationContext (jetbrains.buildServer.buildTriggers.vcs.git.OperationContext)1 ModificationData (jetbrains.buildServer.vcs.ModificationData)1 VcsException (jetbrains.buildServer.vcs.VcsException)1 CommitMountPointInfo (jetbrains.vcs.api.CommitMountPointInfo)1 MissingObjectException (org.eclipse.jgit.errors.MissingObjectException)1 RevWalk (org.eclipse.jgit.revwalk.RevWalk)1