Examples of RevId


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

  private Branch createBranch(final Ref ref, final RefControl refControl,
      final Set<String> targets) {
    final Branch b = createBranch(ref.getName());
    if (ref.getObjectId() != null) {
      b.setRevision(new RevId(ref.getObjectId().name()));
    }
    b.setCanDelete(!targets.contains(ref.getName()) && refControl.canDelete());
    return b;
  }
View Full Code Here

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

    if (patchSet == null) {
      return false;
    }

    final RevId revision = patchSet.getRevision();

    if (revision == null) {
      return false;
    }

    final AnyObjectId objectId = ObjectId.fromString(revision.get());

    if (objectId == null) {
      return false;
    }
View Full Code Here

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

            Change c = db.changes().get(p.getId().getParentKey());
            ca.dependsOn.add(newDependsOn(c, p));
          }
        }

        final RevId revId = db.patchSets().get(psId).getRevision();
        for (PatchSetAncestor a : db.patchSetAncestors().descendantsOf(revId)) {
          final PatchSet p = db.patchSets().get(a.getPatchSet());
          final Change c = db.changes().get(p.getId().getParentKey());
          ca.neededBy.add(newNeededBy(c, p));
        }
View Full Code Here

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

  private Set<PatchSet.Id> parsePatchSetId(final String patchIdentity)
      throws UnloggedFailure, OrmException {
    // By commit?
    //
    if (patchIdentity.matches("^([0-9a-fA-F]{4," + RevId.LEN + "})$")) {
      final RevId id = new RevId(patchIdentity);
      final ResultSet<PatchSet> patches;
      if (id.isComplete()) {
        patches = db.patchSets().byRevision(id);
      } else {
        patches = db.patchSets().byRevisionRange(id, id.max());
      }

      final Set<PatchSet.Id> matches = new HashSet<PatchSet.Id>();
      for (final PatchSet ps : patches) {
        final Change change = db.changes().get(ps.getId().getParentKey());
View Full Code Here

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

    }

    // By commit?
    //
    if (isCommit) {
      RevId id = new RevId(idstr);
      ResultSet<PatchSet> patches;
      if (id.isComplete()) {
        patches = db.patchSets().byRevision(id);
      } else {
        patches = db.patchSets().byRevisionRange(id, id.max());
      }

      for (PatchSet ps : patches) {
        matchChange(matched, ps.getId().getParentKey());
      }
View Full Code Here

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

    final int cnt = src.getParentCount();
    List<PatchSetAncestor> toInsert = new ArrayList<PatchSetAncestor>(cnt);
    for (int p = 0; p < cnt; p++) {
      PatchSetAncestor a =
          new PatchSetAncestor(new PatchSetAncestor.Id(id, p + 1));
      a.setAncestorRevision(new RevId(src.getParent(p).getId().getName()));
      toInsert.add(a);
    }
    db.patchSetAncestors().insert(toInsert);
  }
View Full Code Here

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

        }

        final PatchSet rebasedPatchSet = new PatchSet(change.currPatchSetId());
        rebasedPatchSet.setCreatedOn(change.getCreatedOn());
        rebasedPatchSet.setUploader(user.getAccountId());
        rebasedPatchSet.setRevision(new RevId(rebasedCommitId.getName()));

        insertAncestors(db, rebasedPatchSet.getId(),
            revWalk.parseCommit(rebasedCommitId));

        db.patchSets().insert(Collections.singleton(rebasedPatchSet));
View Full Code Here

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

      change.nextPatchSetId();

      final PatchSet ps = new PatchSet(change.currPatchSetId());
      ps.setCreatedOn(change.getCreatedOn());
      ps.setUploader(user.getAccountId());
      ps.setRevision(new RevId(id.getName()));

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

      final PatchSetInfo info =
          patchSetInfoFactory.get(revWalk.parseCommit(id), ps.getId());
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.