Package org.eclipse.jgit.revwalk

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


  private ObjectIdRef doPeel(final Ref leaf) throws MissingObjectException,
      IOException {
    RevWalk rw = new RevWalk(getRepository());
    try {
      RevObject obj = rw.parseAny(leaf.getObjectId());
      if (obj instanceof RevTag) {
        return new ObjectIdRef.PeeledTag(leaf.getStorage(), leaf
            .getName(), leaf.getObjectId(), rw.peel(obj).copy());
      } else {
        return new ObjectIdRef.PeeledNonTag(leaf.getStorage(), leaf
View Full Code Here


  private Ref doPeel(final Ref leaf) throws MissingObjectException,
      IOException {
    RevWalk rw = new RevWalk(repository);
    try {
      RevObject obj = rw.parseAny(leaf.getObjectId());
      if (obj instanceof RevTag) {
        return new ObjectIdRef.PeeledTag(
            leaf.getStorage(),
            leaf.getName(),
            leaf.getObjectId(),
View Full Code Here

  private DhtRef doPeel(final Ref leaf) throws MissingObjectException,
      IOException {
    RevWalk rw = new RevWalk(getRepository());
    try {
      DhtReader ctx = (DhtReader) rw.getObjectReader();
      RevObject obj = rw.parseAny(leaf.getObjectId());
      RefData.Builder d = RefData.newBuilder(((DhtRef) leaf).getRefData());

      ChunkKey oKey = ctx.findChunk(leaf.getObjectId());
      if (oKey != null)
        d.getTargetBuilder().setChunkKey(oKey.asString());
View Full Code Here

  private void showTag(Ref ref, Repository repo) {
    RevWalk rw = new RevWalk(repo);
    try {
      RevCommit c = null;
      RevObject any = rw.parseAny(ref.getLeaf().getObjectId());
      if (any instanceof RevCommit)
        c = (RevCommit) any;
      else if (any instanceof RevTag) {
        RevTag t = rw.parseTag(any);
        Object anyCommit = rw.parseAny(t.getObject());
View Full Code Here

      RevObject any = rw.parseAny(ref.getLeaf().getObjectId());
      if (any instanceof RevCommit)
        c = (RevCommit) any;
      else if (any instanceof RevTag) {
        RevTag t = rw.parseTag(any);
        Object anyCommit = rw.parseAny(t.getObject());
        if (anyCommit instanceof RevCommit)
          c = (RevCommit) anyCommit;
      }
      if (c != null)
        graph.selectCommit(c);
View Full Code Here

      try {
        RevWalk rw = new RevWalk(repository);
        Map<String, Ref> tags = repository.getRefDatabase().getRefs(
            Constants.R_TAGS);
        for (Ref tagRef : tags.values()) {
          RevObject any = rw.parseAny(repository.resolve(tagRef.getName()));
          if (any instanceof RevTag) {
            RevTag tag = (RevTag) any;
            if (tag.getObject().name().equals(commitId)) {
              Date timestamp;
              if (tag.getTaggerIdent() != null) {
View Full Code Here

      // both RevCommits must be allocated using same RevWalk instance,
      // otherwise isMergedInto returns wrong result!
      RevCommit current = revWalk.parseCommit(commit);
      // tags can point to any object, we only want tags pointing at
      // commits
      RevObject any = revWalk.peel(revWalk.parseAny(ref.getObjectId()));
      if (!(any instanceof RevCommit))
        continue;
      RevCommit newTag = (RevCommit) any;
      if (newTag.getId().equals(commit))
        continue;
View Full Code Here

    RevWalk revWalk = null;
    try {
      ObjectId tagObjectId = repo.resolve(Constants.R_TAGS + tagName);
      if (tagObjectId != null) {
        revWalk = new RevWalk(repo);
        RevObject tagObject = revWalk.parseAny(tagObjectId);
        setExistingTag(tagObject);
        return;
      }
    } catch (IOException e) {
      // See below
View Full Code Here

  private RevObject getTagTarget(Repository repo, ObjectId objectId)
      throws IOException {
    RevWalk rw = new RevWalk(repo);
    try {
      if (objectId == null)
        return rw.parseAny(repo.resolve(Constants.HEAD));
      else
        return rw.parseAny(objectId);
    } finally {
      rw.release();
    }
View Full Code Here

    RevWalk rw = new RevWalk(repo);
    try {
      if (objectId == null)
        return rw.parseAny(repo.resolve(Constants.HEAD));
      else
        return rw.parseAny(objectId);
    } finally {
      rw.release();
    }
  }
}
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.