Package com.google.gerrit.common.data

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


      throw new NoSuchChangeException(changeId);
    }

    final Branch.NameKey destBranch = control.getChange().getDest();
    if (!ProjectUtil.branchExists(repoManager, destBranch)) {
      result.addError(new ReviewResult.Error(
          ReviewResult.Error.Type.DEST_BRANCH_NOT_FOUND, destBranch.get()));
      return result;
    }

    // Create a message to accompany the restored change
View Full Code Here


            }
          }
        });

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

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

    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.canDeleteDraft(db)) {
View Full Code Here

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

    if (!control.canDeleteDraft(db)) {
      result.addError(new ReviewResult.Error(
          ReviewResult.Error.Type.DELETE_NOT_PERMITTED));
      return result;
    }
    final Change change = control.getChange();
View Full Code Here

    final Change change = control.getChange();

    try {
      ChangeUtil.deleteOnlyDraftPatchSet(patch, change, gitManager, replication, db);
    } catch (IOException e) {
      result.addError(new ReviewResult.Error(
          ReviewResult.Error.Type.GIT_ERROR, e.getMessage()));
    }

    List<PatchSet> restOfPatches = db.patchSets().byChange(changeId).toList();
    if (restOfPatches.size() == 0) {
View Full Code Here

    if (restOfPatches.size() == 0) {
      try {
        ChangeUtil.deleteDraftChange(patchSetId, gitManager, replication, db);
        result.setChangeId(null);
      } catch (IOException e) {
        result.addError(new ReviewResult.Error(
            ReviewResult.Error.Type.GIT_ERROR, e.getMessage()));
      }
    } else {
      PatchSet.Id highestId = null;
      for (PatchSet ps : restOfPatches) {
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.