Package org.eclipse.egit.github.core.service

Examples of org.eclipse.egit.github.core.service.CommitService


        Object service = registry.lookupByName("githubCommitService");
        if (service != null) {
            LOG.debug("Using CommitService found in registry " + service.getClass().getCanonicalName());
            commitService = (CommitService) service;
        } else {
            commitService = new CommitService();
        }
        initService(commitService);
       
        LOG.info("GitHub CommitConsumer: Indexing current commits...");
        List<RepositoryCommit> commits = commitService.getCommits(getRepository(), branchName, null);
View Full Code Here


      throws IOException {
    Calendar cal = Calendar.getInstance();
    cal.add(Calendar.DAY_OF_YEAR, -1);
    Date oneDayAgo = cal.getTime();

    CommitService commits = new CommitService();
    if (token != null)
      commits.getClient().setOAuth2Token(token);
    else
      commits.getClient().setCredentials(username, password);
    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);
        }
        curCommit = fullCommit;
      }
View Full Code Here

        return null;
    }

    public static List<CommitComment> getGitCommitComments(Repository gitRepo, EntityRepositoryCommit repoCommit) throws Exception {
        try {
            return new CommitService(AuthServices.getGitHubClient()).getComments(gitRepo, repoCommit.getSha());
        } catch (java.net.UnknownHostException ex) {
            ex.printStackTrace();
            Thread.sleep(100 * 1000);
            return getGitCommitComments(gitRepo, repoCommit);
        } catch (Exception ex) {
View Full Code Here

    public static List<RepositoryCommit> getGitCommitsFromRepository(Repository gitRepo, OutLog out) {
        List<RepositoryCommit> repoCommits = null;
        try {
            out.printLog("Baixando RepositoryCommits...\n");
            repoCommits = new CommitService(AuthServices.getGitHubClient()).getCommits(gitRepo);
            out.printLog(repoCommits.size() + " RepositoryCommits baixados no total!");
        } catch (Exception ex) {
            ex.printStackTrace();
            out.printLog(repoCommits.size() + " RepositoryCommits baixadaos no total! Erro: " + ex.toString());
        }
View Full Code Here

    public static RepositoryCommit getGitRepositoryCommit(Repository gitRepo, RepositoryCommit gitRepoCommit, OutLog out, int nRetries) throws Exception {
        if (nRetries <= 0) {
            return null;
        }
        try {
            return new CommitService(AuthServices.getGitHubClient()).getCommit(gitRepo, gitRepoCommit.getSha());
        } catch (Exception ex) {
            ex.printStackTrace();
            out.printLog("Erro de conexão: " + ex);
            out.printLog("Tentando novamente (" + nRetries + ") ...");
            return getGitRepositoryCommit(gitRepo, gitRepoCommit, out, nRetries);
View Full Code Here

TOP

Related Classes of org.eclipse.egit.github.core.service.CommitService

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.