Examples of AsyncRevObjectQueue


Examples of org.eclipse.jgit.revwalk.AsyncRevObjectQueue

      return last;

    sentReady = false;
    int haveCnt = 0;
    walk.getObjectReader().setAvoidUnreachableObjects(true);
    AsyncRevObjectQueue q = walk.parseAny(peerHas, false);
    try {
      for (;;) {
        RevObject obj;
        try {
          obj = q.next();
        } catch (MissingObjectException notFound) {
          continue;
        }
        if (obj == null)
          break;

        last = obj;
        haveCnt++;

        if (obj instanceof RevCommit) {
          RevCommit c = (RevCommit) obj;
          if (oldestTime == 0 || c.getCommitTime() < oldestTime)
            oldestTime = c.getCommitTime();
        }

        if (obj.has(PEER_HAS))
          continue;

        obj.add(PEER_HAS);
        if (obj instanceof RevCommit)
          ((RevCommit) obj).carry(PEER_HAS);
        addCommonBase(obj);

        // If both sides have the same object; let the client know.
        //
        switch (multiAck) {
        case OFF:
          if (commonBase.size() == 1)
            pckOut.writeString("ACK " + obj.name() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
          break;
        case CONTINUE:
          pckOut.writeString("ACK " + obj.name() + " continue\n"); //$NON-NLS-1$ //$NON-NLS-2$
          break;
        case DETAILED:
          pckOut.writeString("ACK " + obj.name() + " common\n"); //$NON-NLS-1$ //$NON-NLS-2$
          break;
        }
      }
    } finally {
      q.release();
      walk.getObjectReader().setAvoidUnreachableObjects(false);
    }

    int missCnt = peerHas.size() - haveCnt;
View Full Code Here

Examples of org.eclipse.jgit.revwalk.AsyncRevObjectQueue

      }
    }
    if (notAdvertisedWants != null)
      requestValidator.checkWants(this, notAdvertisedWants);

    AsyncRevObjectQueue q = walk.parseAny(wantIds, true);
    try {
      RevObject obj;
      while ((obj = q.next()) != null) {
        want(obj);

        if (!(obj instanceof RevCommit))
          obj.add(SATISFIED);
        if (obj instanceof RevTag) {
          obj = walk.peel(obj);
          if (obj instanceof RevCommit)
            want(obj);
        }
      }
      wantIds.clear();
    } catch (MissingObjectException notFound) {
      ObjectId id = notFound.getObjectId();
      throw new PackProtocolException(MessageFormat.format(
          JGitText.get().wantNotValid, id.name()), notFound);
    } finally {
      q.release();
    }
  }
View Full Code Here

Examples of org.eclipse.jgit.revwalk.AsyncRevObjectQueue

    // commit exists, a branch was deleted or rewound and the repository owner
    // no longer exports that requested item. If the requested commit is merged
    // into an advertised branch it will be marked UNINTERESTING and no commits
    // return.

    AsyncRevObjectQueue q = walk.parseAny(notAdvertisedWants, true);
    try {
      RevObject obj;
      while ((obj = q.next()) != null) {
        if (!(obj instanceof RevCommit))
          throw new PackProtocolException(MessageFormat.format(
            JGitText.get().wantNotValid, obj.name()));
        walk.markStart((RevCommit) obj);
      }
    } catch (MissingObjectException notFound) {
      ObjectId id = notFound.getObjectId();
      throw new PackProtocolException(MessageFormat.format(
          JGitText.get().wantNotValid, id.name()), notFound);
    } finally {
      q.release();
    }
    for (ObjectId id : reachableFrom) {
      try {
        walk.markUninteresting(walk.parseCommit(id));
      } catch (IncorrectObjectTypeException notCommit) {
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.