Package br.edu.utfpr.cm.JGitMinerWeb.model.miner

Examples of br.edu.utfpr.cm.JGitMinerWeb.model.miner.EntityRepositoryCommit


    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) {
                minerCommentsOfRepoCommit(repoCommit, gitRepo);
            }
            repoCommit.setRepository(repository);
            dao.edit(repoCommit);
            if (pullRequest == null) {
                calculeSubProgress(i, gitRepoCommits.size());
            } else {
                pullRequest.addRepoCommit(repoCommit);
View Full Code Here


        }
    }

    private EntityRepositoryCommit minerRepositoryCommit(RepositoryCommit gitRepoCommit) {
        out.printLog("");
        EntityRepositoryCommit repoCommit = null;
        try {
            repoCommit = RepositoryCommitServices.createEntity(gitRepoCommit, dao);
            out.printLog("RepositoryCommit gravado com sucesso: " + gitRepoCommit.getUrl());
        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

    public static EntityRepositoryCommit createEntity(RepositoryCommit gitRepoCommit, GenericDao dao) {
        if (gitRepoCommit == null) {
            return null;
        }

        EntityRepositoryCommit repoCommit = getRepoCommitBySHA(gitRepoCommit.getSha(), dao);

        if (repoCommit == null) {
            repoCommit = new EntityRepositoryCommit();
            repoCommit.setMineredAt(new Date());

//          createParents(repoCommit, gitRepoCommit.getParents(), gitRepo, dao);
            repoCommit.setSha(gitRepoCommit.getSha());
            repoCommit.setUrl(gitRepoCommit.getUrl());
            dao.insert(repoCommit);
        }
        if (repoCommit.getCommit() == null) {
            repoCommit.setCommit(CommitServices.createEntity(gitRepoCommit.getCommit(), dao));
        }
        if (repoCommit.getAuthor() == null) {
            repoCommit.setAuthor(UserServices.createEntity(gitRepoCommit.getAuthor(), dao, false));
        }
        if (repoCommit.getCommitter() == null) {
            repoCommit.setCommitter(UserServices.createEntity(gitRepoCommit.getCommitter(), dao, false));
        }

        return repoCommit;
    }
View Full Code Here

TOP

Related Classes of br.edu.utfpr.cm.JGitMinerWeb.model.miner.EntityRepositoryCommit

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.