Package org.eclipse.orion.server.git.objects

Examples of org.eclipse.orion.server.git.objects.Log


              // set the commit range
              lc.add(toObjectId);
              lc.setMaxCount(this.commitsSize);
              Iterable<RevCommit> commits = lc.call();
              Log log = new Log(cloneLocation, db, commits, null, null, toRefId);
              log.setPaging(1, commitsSize);
              branch.put(GitConstants.KEY_TAG_COMMIT, log.toJSON());
              newChildren.put(branch);
            }
          }

          result.put(ProtocolConstants.KEY_CHILDREN, newChildren);
View Full Code Here


        }
      } else {
        // git log --all
        logCommand.all();
      }
      Log log = new Log(cloneLocation, db, null /* collected by the job */, pattern, toRefId, fromRefId);

      log.setMergeBaseFilter(mergeBaseFilter);

      if (messageFilter != null && messageFilter.length() > 0) {
        log.setMessagePattern(messageFilter);
        logCommand.setMessageFilter(messageFilter);
      }

      if (authorFilter != null && authorFilter.length() > 0) {
        log.setAuthorPattern(authorFilter);
        logCommand.setAuthFilter(authorFilter);
      }

      if (committerFilter != null && committerFilter.length() > 0) {
        log.setCommitterPattern(committerFilter);
        logCommand.setCommitterFilter(committerFilter);
      }

      if (sha1Filter != null && sha1Filter.length() > 0) {
        log.setSHA1Pattern(sha1Filter);
        logCommand.setSHA1Filter(sha1Filter);
      }

      if (fromDate != null && fromDate.length() > 0) {
        log.setFromDate(fromDate);
        if (toDate != null && toDate.length() > 0) {
          log.setToDate(toDate);
          logCommand.setDateFilter(fromDate, toDate);
        } else {
          logCommand.setDateFilter(fromDate, null);
        }
      } else if (toDate != null && toDate.length() > 0) {
        log.setToDate(toDate);
        logCommand.setDateFilter(null, toDate);
      }

      if (page > 0) {
        logCommand.setSkip((page - 1) * pageSize);
        logCommand.setMaxCount(pageSize + 1); // to check if next page
                            // link is needed
      }
      if (pattern != null && !pattern.isEmpty()) {
        logCommand.addPath(pattern);
      }
      log.setPaging(page, pageSize);

      Iterable<RevCommit> commits = logCommand.call();
      log.setCommits(commits);
      JSONObject result = log.toJSON();
      if (mergeBaseFilter) {
        result.put(GitConstants.KEY_BEHIND_COUNT, behindCount);
        result.put(GitConstants.KEY_AHEAD_COUNT, aheadCount);
      }

View Full Code Here

          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()));
        }
      }
      result.put(ProtocolConstants.KEY_CHILDREN, children);
      result.put(ProtocolConstants.KEY_TYPE, Tag.TYPE);
      return new ServerStatus(Status.OK_STATUS, HttpServletResponse.SC_OK, result);
View Full Code Here

            String msg = NLS.bind("No ref or commit found: {0}", branchName);
            return new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_FOUND, msg, null);
          }
          toObjectId = getCommitObjectId(db, toObjectId);

          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()));
        }
      }
      result.put(ProtocolConstants.KEY_CHILDREN, children);
      result.put(ProtocolConstants.KEY_TYPE, Branch.TYPE);
      return new ServerStatus(Status.OK_STATUS, HttpServletResponse.SC_OK, result);
View Full Code Here

TOP

Related Classes of org.eclipse.orion.server.git.objects.Log

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.