Package org.eclipse.jgit.revwalk

Examples of org.eclipse.jgit.revwalk.RevTag


        appendObjectSummary(sb, UIText.RefContentProposal_commit, c
            .getAuthorIdent(), c.getFullMessage());
        break;
      case Constants.OBJ_TAG:
        RevWalk walk = new RevWalk(db);
        RevTag t = walk.parseTag(objectId);
        appendObjectSummary(sb, UIText.RefContentProposal_tag, t
            .getTaggerIdent(), t.getFullMessage());
        break;
      case Constants.OBJ_TREE:
        sb.append(UIText.RefContentProposal_tree);
        break;
      case Constants.OBJ_BLOB:
View Full Code Here


      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());
        if (anyCommit instanceof RevCommit)
          c = (RevCommit) anyCommit;
      }
      if (c != null)
        graph.selectCommit(c);
View Full Code Here

        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) {
                timestamp = tag.getTaggerIdent().getWhen();
              } else {
                try {
                  RevCommit commit = rw.parseCommit(tag.getObject());
                  timestamp = commit.getCommitterIdent().getWhen();
                } catch (IncorrectObjectTypeException e) {
                  // not referencing a comit.
                  timestamp = null;
                }
View Full Code Here

          return true;
        else if (element instanceof Ref) {
          Ref t = (Ref) element;
          name = t.getName().substring(10);
        } else if (element instanceof RevTag) {
          RevTag t = (RevTag) element;
          name = t.getTagName();
        } else
          return true;
        return tagNamePattern.matcher(name).find();
      }
View Full Code Here

  private boolean excludeTag(Ref ref, Repository repo) {
    if (ref instanceof PeeledTag) {
      RevWalk rw = new RevWalk(repo);
      try {
        RevTag tag = rw.parseTag(ref.getObjectId());

        return !(rw.parseAny(tag.getObject()) instanceof RevCommit);
      } catch (IOException e) {
        Activator.logError(e.getMessage(), e);
      } finally {
        rw.dispose();
      }
View Full Code Here

    } catch (CoreException e) {
      // expected
    }
    Ref tagRef = repository1.getRepository().getTags().get("TheNewTag");
    RevWalk walk = new RevWalk(repository1.getRepository());
    RevTag tag = walk.parseTag(
        repository1.getRepository().resolve(tagRef.getName()));

    newTag.setMessage("Another message");
    assertFalse("Messages should differ", tag.getFullMessage().equals(
        newTag.getMessage()));
    top.execute(null);
    tag = walk.parseTag(
        repository1.getRepository().resolve(tagRef.getName()));
    assertTrue("Messages be same", tag.getFullMessage().equals(
        newTag.getMessage()));
  }
View Full Code Here

        }
        ObjectId resolvedCommitId = repo.resolve(name);

        // todo that's a bit of a hack...
        try {
          final RevTag revTag = walk.parseTag(resolvedCommitId);
          ObjectId taggedCommitId = revTag.getObject().getId();
          log("Resolved tag [",revTag.getTagName(),"] [",revTag.getTaggerIdent(),"], points at [",taggedCommitId,"] ");

          // sometimes a tag, may point to another tag, so we need to unpack it
          while (isTagId(taggedCommitId)) {
            taggedCommitId = walk.parseTag(taggedCommitId).getObject().getId();
          }
View Full Code Here

      needs(p);
    obj.add(COMPLETE);
  }

  private void processTag(final RevObject obj) {
    final RevTag tag = (RevTag) obj;
    needs(tag.getObject());
    obj.add(COMPLETE);
  }
View Full Code Here

        // There should be a tag reference
        Ref hotfixTagRef = git.getRepository( ).getTags( ).get( flow.getVersionTagPrefix( ) + "1.0" );

        assertNotNull( hotfixTagRef );

        RevTag hotfixTag = new RevWalk( git.getRepository( ) ).parseTag( hotfixTagRef.getObjectId( ) );

        assertNotNull( hotfixTag );

        RevCommit newMasterHead = GitHelper.getLatestCommit(git, masterBranchName );

        // Check that master has moved
        assertFalse( newMasterHead.equals( oldMasterHead ) );

        // Hotfix tag should reference new master
        assertEquals( newMasterHead, hotfixTag.getObject( ) );
    }
View Full Code Here

   public static List<Ref> getTags(final Git repo) throws JGitInternalException, ConcurrentRefUpdateException,
            InvalidTagNameException, NoHeadException
   {
      TagCommand tagCommand = repo.tag();
      RevTag revTag = tagCommand.call();
      String tagName = revTag.getTagName();

      return null;
   }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.revwalk.RevTag

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.