Examples of LogCommand


Examples of org.eclipse.jgit.api.LogCommand

        Tag tag = tags.get(i);
        if (this.commitsSize == 0) {
          children.put(tag.toJSON());
        } else {
          // add info about commits if requested
          LogCommand lc = git.log();
          String toCommitName = tag.getRevCommitName();
          ObjectId toCommitId = db.resolve(toCommitName);
          Ref toCommitRef = db.getRef(toCommitName);
          toCommitId = getCommitObjectId(db, toCommitId);
          lc.add(toCommitId);
          lc.setMaxCount(this.commitsSize);
          Iterable<RevCommit> commits = lc.call();
          Log log = new Log(cloneLocation, db, commits, null, null, toCommitRef);
          log.setPaging(1, commitsSize);
          children.put(tag.toJSON(log.toJSON()));
        }
      }
View Full Code Here

Examples of org.eclipse.jgit.api.LogCommand

          Log log = null;
          // single commit is requested and we already know it, no need for LogCommand
          if (commitsSize == 1 && toObjectId instanceof RevCommit) {
            log = new Log(cloneLocation, db, Collections.singleton((RevCommit) toObjectId), null, null, toRefId);
          } else {
            LogCommand lc = git.log();
            // set the commit range
            lc.add(toObjectId);
            lc.setMaxCount(this.commitsSize);
            Iterable<RevCommit> commits = lc.call();
            log = new Log(cloneLocation, db, commits, null, null, toRefId);
          }
          log.setPaging(1, commitsSize);
          children.put(branch.toJSON(log.toJSON()));
        }
View Full Code Here

Examples of org.eclipse.jgit.api.LogCommand

        testRepository.getRepository(), commits, messageHandler);
    op.execute(new NullProgressMonitor());

    assertEquals(2, countCommitsInHead());

    LogCommand log = new Git(testRepository.getRepository()).log();
    Iterable<RevCommit> logCommits = log.call();
    RevCommit latestCommit = logCommits.iterator().next();
    assertEquals("squashed", latestCommit.getFullMessage());
  }
View Full Code Here

Examples of org.eclipse.jgit.api.LogCommand

    RevCommit latestCommit = logCommits.iterator().next();
    assertEquals("squashed", latestCommit.getFullMessage());
  }

  private int countCommitsInHead() throws GitAPIException {
    LogCommand log = new Git(testRepository.getRepository()).log();
    Iterable<RevCommit> commits = log.call();
    int result = 0;
    for (Iterator i = commits.iterator(); i.hasNext();) {
      i.next();
      result++;
    }
View Full Code Here

Examples of org.eclipse.jgit.api.LogCommand

        ref = repository.peel(ref);
        RevWalk walker = new RevWalk(repository);
        walker.setRetainBody(true);
        try {
            RevCommit commit = walker.parseCommit(ref.getObjectId());
            LogCommand command = git.log();
            command.add(commit.getId());
            command.setMaxCount(12);
            for (RevCommit rev : command.call()) {
                commit = walker.parseCommit(rev);
                print(commit);
            }
        } finally {
            walker.dispose();
View Full Code Here

Examples of org.eclipse.jgit.api.LogCommand

    protected void addCommitsAsChildren( Git git,
                                         CallSpecification spec,
                                         DocumentWriter writer,
                                         int pageSize ) throws GitAPIException {
        // Add commits in the log ...
        LogCommand command = git.log();
        command.setSkip(0);
        command.setMaxCount(pageSize);

        // Add the first set of commits ...
        int actual = 0;
        String commitId = null;
        for (RevCommit commit : command.call()) {
            commitId = commit.getName();
            writer.addChild(spec.childId(commitId), commitId);
            ++actual;
        }
        if (actual == pageSize) {
View Full Code Here

Examples of org.eclipse.jgit.api.LogCommand

            // The offset is the ID of the last commit we read, so we'll need to skip the first commit
            String lastCommitIdName = pageKey.getOffsetString();
            ObjectId lastCommitId = repository.resolve(lastCommitIdName);
            int pageSize = (int)pageKey.getBlockSize();

            LogCommand command = git.log();
            command.add(lastCommitId);
            command.setMaxCount(pageSize + 1);
            // Add the first set of commits ...
            int actual = 0;
            String commitId = null;
            for (RevCommit commit : command.call()) {
                commitId = commit.getName();
                if (commitId.equals(lastCommitIdName)) continue;
                writer.addChild(spec.childId(commitId), commitId);
                ++actual;
            }
View Full Code Here

Examples of org.eclipse.jgit.api.LogCommand

  public void reword() throws Exception {
    RewordCommitOperation op = new RewordCommitOperation(
        testRepository.getRepository(), commit, "new message");
    op.execute(new NullProgressMonitor());

    LogCommand log = new Git(testRepository.getRepository()).log();
    RevCommit newCommit = log.call().iterator().next();
    assertEquals("new message", newCommit.getFullMessage());
  }
View Full Code Here

Examples of org.eclipse.jgit.api.LogCommand

        FastForwardMode.Merge.valueOf(ffMode));
    config.save();
  }

  private int countCommitsInHead() throws GitAPIException {
    LogCommand log = new Git(testRepository.getRepository()).log();
    Iterable<RevCommit> commits = log.call();
    int result = 0;
    for (Iterator i = commits.iterator(); i.hasNext();) {
      i.next();
      result++;
    }
View Full Code Here

Examples of org.eclipse.jgit.api.LogCommand

        final List<VersionRecord> records = new ArrayList<VersionRecord>();

        if ( id != null ) {
            try {
                final LogCommand logCommand = fs.gitRepo().log().add( id );
                if ( !gPath.isEmpty() ) {
                    logCommand.addPath( gPath );
                }

                for ( final RevCommit commit : logCommand.call() ) {

                    records.add( new VersionRecord() {
                        @Override
                        public String id() {
                            return commit.name();
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.