Examples of RevId


Examples of com.google.gerrit.reviewdb.client.RevId

        openSchema();
        preMerge();

        // update sha1 tested merge.
        if (destBranchRef != null) {
          change.setLastSha1MergeTested(new RevId(destBranchRef
              .getObjectId().getName()));
        } else {
          change.setLastSha1MergeTested(new RevId(""));
        }
        change.setMergeable(isMergeable(change));
        db.changes().update(Collections.singleton(change));
      }
    } catch (MergeException e) {
View Full Code Here

Examples of com.google.gerrit.reviewdb.client.RevId

            });

    final PatchSet ps = new PatchSet(n.change.currPatchSetId());
    ps.setCreatedOn(new Timestamp(System.currentTimeMillis()));
    ps.setUploader(submitAudit.getAccountId());
    ps.setRevision(new RevId(id.getName()));
    insertAncestors(ps.getId(), newCommit);
    db.patchSets().insert(Collections.singleton(ps));

    n.change =
        db.changes().atomicUpdate(n.change.getId(),
View Full Code Here

Examples of com.google.gerrit.reviewdb.client.RevId

    List<PatchSetAncestor> toInsert = new ArrayList<PatchSetAncestor>(cnt);
    for (int p = 0; p < cnt; p++) {
      PatchSetAncestor a;

      a = new PatchSetAncestor(new PatchSetAncestor.Id(id, p + 1));
      a.setAncestorRevision(new RevId(src.getParent(p).getId().name()));
      toInsert.add(a);
    }
    db.patchSetAncestors().insert(toInsert);
  }
View Full Code Here

Examples of com.google.gerrit.reviewdb.client.RevId

  private void loadChangeInfo(final CodeReviewCommit commit) {
    if (commit.patchsetId == null) {
      try {
        List<PatchSet> matches =
            db.patchSets().byRevision(new RevId(commit.name())).toList();
        if (matches.size() == 1) {
          final PatchSet ps = matches.get(0);
          commit.patchsetId = ps.getId();
          commit.change = db.changes().get(ps.getId().getParentKey());
        }
View Full Code Here

Examples of com.google.gerrit.reviewdb.client.RevId

    return false;
  }

  @Override
  public ResultSet<ChangeData> read() throws OrmException {
    final RevId id = new RevId(abbreviated().name());
    if (id.isComplete()) {
      return ChangeDataResultSet.patchSet(//
          dbProvider.get().patchSets().byRevision(id));

    } else {
      return ChangeDataResultSet.patchSet(//
          dbProvider.get().patchSets().byRevisionRange(id, id.max()));
    }
  }
View Full Code Here

Examples of com.google.gerrit.reviewdb.client.RevId

      final RevWalk walk) throws IOException, MissingObjectException {
    List<PatchSetInfo.ParentInfo> pInfos =
      new ArrayList<PatchSetInfo.ParentInfo>(parents.length);
    for (RevCommit parent : parents) {
      walk.parseBody(parent);
      RevId rev = new RevId(parent.getId().name());
      String msg = parent.getShortMessage();
      pInfos.add(new PatchSetInfo.ParentInfo(rev, msg));
    }
    return pInfos;
  }
View Full Code Here

Examples of com.google.gerrit.reviewdb.client.RevId

        }
      }
    }

    final Set<PatchSet.Id> descendants = new HashSet<PatchSet.Id>();
    RevId cprev;
    for (PatchSet p : detail.getPatchSets()) {
      cprev = p.getRevision();
      if (cprev != null) {
        for (PatchSetAncestor a : db.patchSetAncestors().descendantsOf(cprev)) {
          if (descendants.add(a.getPatchSet())) {
View Full Code Here

Examples of com.google.gerrit.reviewdb.client.RevId

    }
    db.patchSetAncestors().insert(toInsert);
  }

  private static RevId toRevId(final RevCommit src) {
    return new RevId(src.getId().name());
  }
View Full Code Here

Examples of com.google.gerrit.reviewdb.client.RevId

                GitRepositoryManager.REF_CONFIG));
    change.nextPatchSetId();

    ps.setCreatedOn(change.getCreatedOn());
    ps.setUploader(user.getAccountId());
    ps.setRevision(new RevId(commit.name()));

    db.patchSets().insert(Collections.singleton(ps));

    final PatchSetInfo info = patchSetInfoFactory.get(commit, ps.getId());
    change.setCurrentPatchSet(info);
View Full Code Here

Examples of com.google.gerrit.reviewdb.client.RevId

          if (target.startsWith(Constants.R_HEADS)) {
            target = target.substring(Constants.R_HEADS.length());
          }

          Branch b = createBranch(ref.getName());
          b.setRevision(new RevId(target));

          if (Constants.HEAD.equals(ref.getName())) {
            b.setCanDelete(false);
            headBranch = b;
          } else {
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.