Package org.eclipse.jgit.revwalk

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


  private int countCommits(String baseId, String tipId) {
    int count = 0;
    RevWalk walk = getRevWalk();
    walk.reset();
    walk.sort(RevSort.TOPO);
    walk.sort(RevSort.REVERSE, true);
    try {
      RevCommit tip = walk.parseCommit(getRepository().resolve(tipId));
      RevCommit base = walk.parseCommit(getRepository().resolve(baseId));
      walk.markStart(tip);
View Full Code Here


  private int countCommits(String baseId, String tipId) {
    int count = 0;
    RevWalk walk = getRevWalk();
    walk.reset();
    walk.sort(RevSort.TOPO);
    walk.sort(RevSort.REVERSE, true);
    try {
      RevCommit tip = walk.parseCommit(getRepository().resolve(tipId));
      RevCommit base = walk.parseCommit(getRepository().resolve(baseId));
      walk.markStart(tip);
      walk.markUninteresting(base);
View Full Code Here

    if (commitFilter instanceof CommitFilter)
      ((CommitFilter) commitFilter).setRepository(repository);
    if (treeFilter instanceof BaseTreeFilter)
      ((BaseTreeFilter) treeFilter).setRepository(repository);
    if (sort != null)
      walk.sort(sort);
    return walk;
  }

  /**
   * Traverse the commits in the given {@link RevWalk}
View Full Code Here

   * @throws Exception
   */
  private void doTestRebasePreservingMergesWithUnrelatedSide(
      boolean testConflict) throws Exception {
    RevWalk rw = new RevWalk(db);
    rw.sort(RevSort.TOPO);

    writeTrashFile(FILE1, FILE1);
    git.add().addFilepattern(FILE1).call();
    RevCommit a = git.commit().setMessage("commit a").call();

View Full Code Here

      assertEquals(RebaseResult.OK_RESULT, res.getRebaseResult());
    }
    assertFileContentsEqual(sourceFile, "content");

    RevWalk rw = new RevWalk(dbTarget);
    rw.sort(RevSort.TOPO);
    rw.markStart(rw.parseCommit(dbTarget.resolve("refs/heads/master")));

    RevCommit next;
    if (expectedPullMode == TestPullMode.MERGE) {
      next = rw.next();
View Full Code Here

            sortings = new RevSort[]{ RevSort.TOPO, RevSort.COMMIT_TIME_DESC };
        }

        for ( final RevSort s : sortings )
        {
            walk.sort( s, true );
        }

        if ( fromDate != null && toDate != null )
        {
            //walk.setRevFilter( CommitTimeRevFilter.between( fromDate, toDate ) );
View Full Code Here

        RevWalk revWalk = null;
        try {
            revWalk = new RevWalk(repository);
            revWalk.markStart(start);
            revWalk.setTreeFilter(PathFilter.create(path));
            revWalk.sort(RevSort.REVERSE);
            RevCommit commit = revWalk.next();
            if (commit == null) {
                return User.anonymous;
            }
            return findAuthorByPersonIdent(commit.getAuthorIdent());
View Full Code Here

    Repository repository = getRepository();
    IResource resource = getSelectedResources()[0];
    String path = RepositoryMapping.getMapping(resource.getProject())
        .getRepoRelativePath(resource);
    RevWalk rw = new RevWalk(repository);
    rw.sort(RevSort.COMMIT_TIME_DESC, true);
    rw.sort(RevSort.BOUNDARY, true);
    try {
      if (path.length() > 0) {
        DiffConfig diffConfig = repository.getConfig().get(
            DiffConfig.KEY);
View Full Code Here

    IResource resource = getSelectedResources()[0];
    String path = RepositoryMapping.getMapping(resource.getProject())
        .getRepoRelativePath(resource);
    RevWalk rw = new RevWalk(repository);
    rw.sort(RevSort.COMMIT_TIME_DESC, true);
    rw.sort(RevSort.BOUNDARY, true);
    try {
      if (path.length() > 0) {
        DiffConfig diffConfig = repository.getConfig().get(
            DiffConfig.KEY);
        FollowFilter filter = FollowFilter.create(path, diffConfig);
View Full Code Here

  }

  private void getRevCommits(Collection<RevCommit> commits) {
    final RevWalk revWalk = new RevWalk(repo);
    try {
      revWalk.sort(RevSort.COMMIT_TIME_DESC, true);
      revWalk.sort(RevSort.BOUNDARY, true);
      AnyObjectId headId = repo.resolve(Constants.HEAD);
      if (headId != null)
        revWalk.markStart(revWalk.parseCommit(headId));
      // do the walk to get the commits
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.