Package org.eclipse.jgit.revwalk

Examples of org.eclipse.jgit.revwalk.RevWalk.parseCommit()


        rebasedPatchSet.setCreatedOn(change.getCreatedOn());
        rebasedPatchSet.setUploader(user.getAccountId());
        rebasedPatchSet.setRevision(new RevId(rebasedCommitId.getName()));

        insertAncestors(db, rebasedPatchSet.getId(),
            revWalk.parseCommit(rebasedCommitId));

        db.patchSets().insert(Collections.singleton(rebasedPatchSet));
        final PatchSetInfo info =
            patchSetInfoFactory.get(db, rebasedPatchSet.getId());
View Full Code Here


    };

    final RevWalk revWalk = new RevWalk(git);
    try {
      RevCommit commitToRevert =
          revWalk.parseCommit(ObjectId.fromString(patch.getRevision().get()));

      PersonIdent authorIdent =
          user.newCommitterIdent(myIdent.getWhen(), myIdent.getTimeZone());

      RevCommit parentToCommitToRevert = commitToRevert.getParent(0);
View Full Code Here

      ps.setRevision(new RevId(id.getName()));

      db.patchSets().insert(Collections.singleton(ps));

      final PatchSetInfo info =
          patchSetInfoFactory.get(revWalk.parseCommit(id), ps.getId());
      change.setCurrentPatchSet(info);
      ChangeUtil.updated(change);
      db.changes().insert(Collections.singleton(change));

      final RefUpdate ru = git.updateRef(ps.getRefName());
View Full Code Here

                    .from(context.getRefs())
                    .transform(new Function<Ref, RevCommit>() {
                        @Override
                        public RevCommit apply(Ref ref) {
                            try {
                                return walk.parseCommit(ref.getObjectId());
                            } catch (Throwable e) {
                                logger.error(this.getClass().getName(), e);
                                return null;
                            }
                        }
View Full Code Here

      throws MissingObjectException, IncorrectObjectTypeException,
      IOException {
    final RevWalk rw = new RevWalk(db);
    final RevCommit commit;
    try {
      commit = rw.parseCommit(branch.getObjectId());
    } finally {
      rw.release();
    }
    return commit;
  }
View Full Code Here

    }

    public boolean isCommitInRepo(String sha1) {
        RevWalk revWalk = new RevWalk(jGitDelegate.getRepository());
        try {
            revWalk.parseCommit(ObjectId.fromString(sha1));
        } catch (IOException e) {
            return false;
        }
        return true;
    }
View Full Code Here

    // takes about 1 sec to count 69939 in intellijidea repo
    private static int countCommits(FileRepository repo, ObjectId revision) throws IOException {
        RevWalk walk = new RevWalk(repo);
        walk.setRetainBody(false);
        RevCommit head = walk.parseCommit(revision);
        walk.markStart(head);
        int res = 0;
        for (RevCommit commit : walk) res += 1;
        return res;
    }
View Full Code Here

        if (null == branch)
        {
            throw new MissingBranchException(branchName + " does not exist");
        }
        RevCommit branchCommit = walk.parseCommit(branch);

        return isMergedInto(git, branchCommit, baseName);
    }

    public static boolean isMergedInto(Git git, RevCommit commit, String branchName) throws IOException, GitAPIException
View Full Code Here

        ObjectId branch = git.getRepository().resolve(branchName);
        RevWalk walk = new RevWalk(git.getRepository());
        walk.setRetainBody(true);
        try
        {
            return walk.parseCommit(branch);
        }
        finally
        {
            walk.release();
        }
View Full Code Here

            if (null != masterBranch)
            {
                try
                {
                    masterCommit = walk.parseCommit(masterBranch);
                }
                catch (MissingObjectException e)
                {
                    //ignore
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.