Package org.eclipse.egit.github.core

Examples of org.eclipse.egit.github.core.RepositoryCommit


                commitHashes.add(commit.getSha());
            }
        }
       
        while (!newCommits.empty()) {
            RepositoryCommit newCommit = newCommits.pop();
            Exchange e = getEndpoint().createExchange();
            e.getIn().setBody(newCommit);
            getProcessor().process(e);
        }
        return newCommits.size();
View Full Code Here



    @Test
    public void commitConsumerTest() throws Exception {
        mockResultEndpoint.expectedMessageCount(2);
        RepositoryCommit commit1 = commitService.addRepositoryCommit();
        RepositoryCommit commit2 = commitService.addRepositoryCommit();
        mockResultEndpoint.expectedBodiesReceivedInAnyOrder(commit1, commit2);

        Thread.sleep(1 * 1000);

        mockResultEndpoint.assertIsSatisfied();
View Full Code Here

    public class GitHubCommitProcessor implements Processor {
        @Override
        public void process(Exchange exchange) throws Exception {
            Message in = exchange.getIn();
            RepositoryCommit commit = (RepositoryCommit) in.getBody();
            User author = commit.getAuthor();
            log.debug("Got commit with author: " + author.getLogin() + ": " + author.getHtmlUrl() + " SHA " + commit.getSha());
        }
View Full Code Here

        User author = new User();
        author.setEmail("someguy@gmail.com");       // TODO change
        author.setHtmlUrl("http://github/someguy");
        author.setLogin("someguy");

        RepositoryCommit rc = new RepositoryCommit();
        rc.setAuthor(author);
        rc.setSha(fakeSha.incrementAndGet() + "");
        LOG.debug("In MockCommitService added commit with sha " + rc.getSha());
        commitsList.add(rc);

        return rc;
    }
View Full Code Here

    final List<Commit> ret = new ArrayList<Commit>();
    RepositoryId repositoryId = new RepositoryId(owner, repository);
    for (RepositoryCommit curCommit : commits.pageCommits(repositoryId, 30)
        .next()) {
      if (curCommit.getCommit().getCommitter().getDate().after(oneDayAgo)) {
        RepositoryCommit fullCommit = fullCommits.get(curCommit
            .getSha());
        if (fullCommit == null) {
          fullCommit = commits.getCommit(repositoryId,
              curCommit.getSha());
          fullCommits.put(curCommit.getSha(), fullCommit);
View Full Code Here

    private void minerRepositoryCommits(List<RepositoryCommit> gitRepoCommits, Repository gitRepo, EntityPullRequest pullRequest) throws Exception {
        EntityRepository repository = dao.findByID(repositoryToMinerId, EntityRepository.class);
        int i = 0;
        while (!canceled && i < gitRepoCommits.size()) {
            RepositoryCommit gitRepoCommit = gitRepoCommits.get(i);
            EntityRepositoryCommit repoCommit = minerRepositoryCommit(gitRepoCommit);
            if (minerStatsAndFilesOfCommits) {
                minerStatsAndFilesOfCommit(repoCommit, gitRepoCommit, gitRepo);
            }
            if (minerCommentsOfRepositoryCommits) {
View Full Code Here

    }

    private void minerStatsAndFilesOfCommit(EntityRepositoryCommit repoCommit, RepositoryCommit gitRepoCommit, Repository gitRepo) throws Exception {
        if (repoCommit.getFiles().isEmpty() || repoCommit.getStats() == null) {
            out.printLog("Baixando Stats and Files do Commit...");
            RepositoryCommit gitRepoCommitUpdated = RepositoryCommitServices.getGitRepositoryCommit(gitRepo, gitRepoCommit, out, 5);
            if (gitRepoCommitUpdated != null) {
                gitRepoCommit = gitRepoCommitUpdated;
                if (repoCommit.getStats() == null) {
                    minerStatsOfCommit(repoCommit, gitRepoCommit.getStats());
                }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.github.core.RepositoryCommit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.