Package com.google.gerrit.common.data

Examples of com.google.gerrit.common.data.ReviewResult.addError()


    final PatchSet patch = db.patchSets().get(patchSetId);
    if (patch == null) {
      throw new NoSuchChangeException(changeId);
    }
    if (!patch.isDraft()) {
      result.addError(new ReviewResult.Error(
          ReviewResult.Error.Type.NOT_A_DRAFT));
      return result;
    }

    if (!control.canPublish(db)) {
View Full Code Here


          ReviewResult.Error.Type.NOT_A_DRAFT));
      return result;
    }

    if (!control.canPublish(db)) {
      result.addError(new ReviewResult.Error(
          ReviewResult.Error.Type.PUBLISH_NOT_PERMITTED));
    } else {
      boolean published = false;
      final PatchSet updatedPatch = db.patchSets().atomicUpdate(patchSetId,
          new AtomicUpdate<PatchSet>() {
View Full Code Here

    final ChangeControl control = changeControlFactory.validateFor(changeId);
    final Change change = db.changes().get(changeId);
    final PatchSet.Id patchSetId = change.currentPatchSetId();
    final PatchSet patch = db.patchSets().get(patchSetId);
    if (!control.canAbandon()) {
      result.addError(new ReviewResult.Error(
          ReviewResult.Error.Type.ABANDON_NOT_PERMITTED));
    } else if (patch == null) {
      throw new NoSuchChangeException(changeId);
    } else {
View Full Code Here

          }
        }
      });

      if (updatedChange == null) {
        result.addError(new ReviewResult.Error(
            ReviewResult.Error.Type.CHANGE_IS_CLOSED));
        return result;
      }

      ChangeUtil.updatedChange(db, currentUser, updatedChange, cmsg,
View Full Code Here

    for (SubmitRecord submitRecord : submitResult) {
      switch (submitRecord.status) {
        case OK:
          if (!control.getRefControl().canSubmit()) {
            result.addError(new ReviewResult.Error(
              ReviewResult.Error.Type.SUBMIT_NOT_PERMITTED));
          }
          break;

        case NOT_READY:
View Full Code Here

                throw new IllegalArgumentException(
                    "Unsupported SubmitRecord.Label.status (" + lbl.status
                    + ")");
            }
          }
          result.addError(new ReviewResult.Error(
            ReviewResult.Error.Type.SUBMIT_NOT_READY, errMsg.toString()));
          break;

        case CLOSED:
          result.addError(new ReviewResult.Error(
View Full Code Here

          result.addError(new ReviewResult.Error(
            ReviewResult.Error.Type.SUBMIT_NOT_READY, errMsg.toString()));
          break;

        case CLOSED:
          result.addError(new ReviewResult.Error(
            ReviewResult.Error.Type.CHANGE_IS_CLOSED));
          break;

        case RULE_ERROR:
          result.addError(new ReviewResult.Error(
View Full Code Here

          result.addError(new ReviewResult.Error(
            ReviewResult.Error.Type.CHANGE_IS_CLOSED));
          break;

        case RULE_ERROR:
          result.addError(new ReviewResult.Error(
            ReviewResult.Error.Type.RULE_ERROR,
            submitResult.get(0).errorMessage));
          break;

        default:
View Full Code Here

              + ")");
      }
    }

    if (!ProjectUtil.branchExists(repoManager, control.getChange().getDest())) {
      result.addError(new ReviewResult.Error(
          ReviewResult.Error.Type.DEST_BRANCH_NOT_FOUND,
          "Destination branch \"" + control.getChange().getDest().get()
              + "\" not found."));
      return result;
    }
View Full Code Here

    final ChangeControl control = changeControlFactory.validateFor(changeId);
    final Change change = db.changes().get(changeId);
    final PatchSet.Id patchSetId = change.currentPatchSetId();
    if (!control.canRestore()) {
      result.addError(new ReviewResult.Error(
          ReviewResult.Error.Type.RESTORE_NOT_PERMITTED));
      return result;
    }

    final PatchSet patch = db.patchSets().get(patchSetId);
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.