Package org.eclipse.jgit.revwalk

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


    RevWalk walk = new RevWalk(db);
    try {
      String tagName = toPut.getString(ProtocolConstants.KEY_NAME);
      String commitId = toPut.getString(GitConstants.KEY_TAG_COMMIT);
      ObjectId objectId = db.resolve(commitId);
      RevCommit revCommit = walk.lookupCommit(objectId);

      Ref ref = tag(git, revCommit, tagName);
      URI cloneLocation = BaseToCloneConverter.getCloneLocation(getURI(request), BaseToCloneConverter.TAG_LIST);
      Tag tag = new Tag(cloneLocation, db, ref);
      OrionServlet.writeJSONResponse(request, response, tag.toJSON(), JsonURIUnqualificationStrategy.ALL_NO_GIT);
View Full Code Here


      int aheadCount = 0, behindCount = 0;
      if (mergeBaseFilter) {
        RevWalk walk = new RevWalk(db);
        try {
          walk.setRevFilter(RevFilter.MERGE_BASE);
          RevCommit toRevCommit = walk.lookupCommit(toObjectId);
          walk.markStart(toRevCommit);
          RevCommit fromRevCommit = walk.lookupCommit(fromObjectId);
          walk.markUninteresting(fromRevCommit);
          RevCommit next = walk.next();
          walk.reset();
View Full Code Here

        RevWalk walk = new RevWalk(db);
        try {
          walk.setRevFilter(RevFilter.MERGE_BASE);
          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);
View Full Code Here

      throws JSONException, URISyntaxException, ServletException {
    Git git = new Git(db);
    RevWalk walk = new RevWalk(db);
    try {
      ObjectId objectId = db.resolve(commitId);
      RevCommit revCommit = walk.lookupCommit(objectId);
      walk.parseBody(revCommit);

      GitTagHandlerV1.tag(git, revCommit, tagName);

      URI cloneLocation = BaseToCloneConverter.getCloneLocation(getURI(request), BaseToCloneConverter.COMMIT_REFRANGE);
View Full Code Here

      StringBuilder refLogMessage = new StringBuilder("merge ");

      // Check for FAST_FORWARD, ALREADY_UP_TO_DATE
      RevWalk revWalk = new RevWalk(repo);
      try {
        RevCommit headCommit = revWalk.lookupCommit(head.getObjectId());

        Ref ref = commits.get(0);

        refLogMessage.append(ref.getName());
View Full Code Here

        // handle annotated tags
        ObjectId objectId = ref.getPeeledObjectId();
        if (objectId == null)
          objectId = ref.getObjectId();

        RevCommit srcCommit = revWalk.lookupCommit(objectId);
        if (revWalk.isMergedInto(srcCommit, headCommit)) {
          setCallable(false);
          return new MergeResult(headCommit,
              MergeStatus.ALREADY_UP_TO_DATE, mergeStrategy);
        } else if (revWalk.isMergedInto(headCommit, srcCommit)) {
View Full Code Here

      // handle annotated tags
      ObjectId objectId = ref.getPeeledObjectId();
      if (objectId == null)
        objectId = ref.getObjectId();

      RevCommit srcCommit = revWalk.lookupCommit(objectId);

      ObjectId headId = head.getObjectId();
      if (headId == null) {
        revWalk.parseHeaders(srcCommit);
        dco = new DirCacheCheckout(repo,
View Full Code Here

        return new MergeResult(srcCommit, srcCommit, new ObjectId[] {
            null, srcCommit }, MergeStatus.FAST_FORWARD,
            mergeStrategy, null, null);
      }

      RevCommit headCommit = revWalk.lookupCommit(headId);

      if (revWalk.isMergedInto(srcCommit, headCommit)) {
        setCallable(false);
        return new MergeResult(headCommit, srcCommit, new ObjectId[] {
            headCommit, srcCommit },
View Full Code Here

    RevWalk rw = new RevWalk(repo);
    try {
      rw.setRetainBody(false);
      rw.setRevFilter(RevFilter.MERGE_BASE);

      RevCommit srcRev = rw.lookupCommit(commit1);
      RevCommit dstRev = rw.lookupCommit(commit2);

      rw.markStart(dstRev);
      rw.markStart(srcRev);
View Full Code Here

    try {
      rw.setRetainBody(false);
      rw.setRevFilter(RevFilter.MERGE_BASE);

      RevCommit srcRev = rw.lookupCommit(commit1);
      RevCommit dstRev = rw.lookupCommit(commit2);

      rw.markStart(dstRev);
      rw.markStart(srcRev);

      RevCommit result = rw.next();
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.