Package org.eclipse.jgit.revwalk

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


  }

  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));
View Full Code Here


        sendError("You may not create a ''{0}'' branch proposal ticket from {1} commits!",
            forBranch, patchset.commits);
        sendError("");
        // display an ellipsized log of the commits being pushed
        RevWalk walk = getRevWalk();
        walk.reset();
        walk.sort(RevSort.TOPO);
        int boundary = 3;
        int count = 0;
        try {
          walk.markStart(tipCommit);
View Full Code Here

   */
  private Collection<TicketModel> processMergedTickets(ReceiveCommand cmd) {
    Map<Long, TicketModel> mergedTickets = new LinkedHashMap<Long, TicketModel>();
    final RevWalk rw = getRevWalk();
    try {
      rw.reset();
      rw.markStart(rw.parseCommit(cmd.getNewId()));
      if (!ObjectId.zeroId().equals(cmd.getOldId())) {
        rw.markUninteresting(rw.parseCommit(cmd.getOldId()));
      }

View Full Code Here

        }
      }
    } catch (IOException e) {
      LOGGER.error("Can't scan for changes to close", e);
    } finally {
      rw.reset();
    }

    return mergedTickets.values();
  }
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));
View Full Code Here

    walk.setRevFilter(RevFilter.MERGE_BASE);
    walk.markStart(localCommit);
    walk.markStart(trackingCommit);
    RevCommit mergeBase = walk.next();

    walk.reset();
    walk.setRevFilter(RevFilter.ALL);
    int aheadCount = RevWalkUtils.count(walk, localCommit, mergeBase);
    int behindCount = RevWalkUtils.count(walk, trackingCommit, mergeBase);

    return new BranchTrackingStatus(trackingBranch, aheadCount, behindCount);
View Full Code Here

        nextIn = nextSelectionDistance(index, cardinality);
        nextFlg = nextIn == maxCommits ? PackBitmapIndex.FLAG_REUSE : 0;
        mustPick = nextIn == 0;

        BitmapBuilder fullBitmap = commitBitmapIndex.newBitmapBuilder();
        rw.reset();
        rw.markStart(c);
        for (AnyObjectId objectId : result.reuse)
          rw.markUninteresting(rw.parseCommit(objectId));
        rw.setRevFilter(
            PackWriterBitmapWalker.newRevFilter(null, fullBitmap));
View Full Code Here

          RevCommit toRevCommit = walk.lookupCommit(toObjectId);
          walk.markStart(toRevCommit);
          RevCommit fromRevCommit = walk.lookupCommit(fromObjectId);
          walk.markUninteresting(fromRevCommit);
          RevCommit next = walk.next();
          walk.reset();
          walk.setRevFilter(RevFilter.ALL);
          aheadCount = RevWalkUtils.count(walk, toRevCommit, next);
          behindCount = RevWalkUtils.count(walk, fromRevCommit, next);
          toObjectId = next.toObjectId();
          fromObjectId = null;
View Full Code Here

    walk.setRevFilter(RevFilter.MERGE_BASE);
    walk.markStart(localCommit);
    walk.markStart(trackingCommit);
    RevCommit mergeBase = walk.next();

    walk.reset();
    walk.setRevFilter(RevFilter.ALL);
    int aheadCount = RevWalkUtils.count(walk, localCommit, mergeBase);
    int behindCount = RevWalkUtils.count(walk, trackingCommit, mergeBase);

    return new BranchTrackingStatus(remoteTrackingBranch, aheadCount, behindCount);
View Full Code Here

    RevWalk walk = new RevWalk(repository);
    ObjectId headCommitId = repository.resolve(Constants.HEAD);
    RevCommit headCommit = walk.parseCommit(headCommitId);

    for (final RevCommit commit : commits) {
      walk.reset();
      walk.markStart(headCommit);

      RevFilter revFilter = new RevFilter() {
        @Override
        public boolean include(RevWalk walker, RevCommit cmit)
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.