Package org.eclipse.orion.server.git.objects

Examples of org.eclipse.orion.server.git.objects.Tag.toJSON()


        URI cloneLocation = BaseToCloneConverter.getCloneLocation(getURI(request), BaseToCloneConverter.TAG);

        Ref ref = db.getRefDatabase().getRef(Constants.R_TAGS + tagName);
        if (ref != null) {
          Tag tag = new Tag(cloneLocation, db, ref);
          OrionServlet.writeJSONResponse(request, response, tag.toJSON(), JsonURIUnqualificationStrategy.ALL_NO_GIT);
          return true;
        } else {
          String msg = NLS.bind("Tag not found: {0}", tagName);
          return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_FOUND, msg, null));
        }
View Full Code Here


      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);
      return true;
    } catch (Exception e) {
      return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
          "An error occured when tagging.", e));
    } finally {
View Full Code Here

        result.put(ProtocolConstants.KEY_NEXT_LOCATION, next);
      }
      for (int i = firstTag; i <= lastTag; i++) {
        Tag tag = tags.get(i);
        if (this.commitsSize == 0) {
          children.put(tag.toJSON());
        } else {
          // add info about commits if requested
          LogCommand lc = git.log();
          String toCommitName = tag.getRevCommitName();
          ObjectId toCommitId = db.resolve(toCommitName);
View Full Code Here

          lc.add(toCommitId);
          lc.setMaxCount(this.commitsSize);
          Iterable<RevCommit> commits = lc.call();
          Log log = new Log(cloneLocation, db, commits, null, null, toCommitRef);
          log.setPaging(1, commitsSize);
          children.put(tag.toJSON(log.toJSON()));
        }
      }
      result.put(ProtocolConstants.KEY_CHILDREN, children);
      result.put(ProtocolConstants.KEY_TYPE, Tag.TYPE);
      return new ServerStatus(Status.OK_STATUS, HttpServletResponse.SC_OK, result);
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.