当前位置: 首页>>代码示例>>Java>>正文


Java ApprovalsUtil类代码示例

本文整理汇总了Java中com.google.gerrit.server.ApprovalsUtil的典型用法代码示例。如果您正苦于以下问题:Java ApprovalsUtil类的具体用法?Java ApprovalsUtil怎么用?Java ApprovalsUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ApprovalsUtil类属于com.google.gerrit.server包,在下文中一共展示了ApprovalsUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PushOneCommit

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@AssistedInject
PushOneCommit(
    ChangeNotes.Factory notesFactory,
    ApprovalsUtil approvalsUtil,
    Provider<InternalChangeQuery> queryProvider,
    NotesMigration notesMigration,
    @Assisted ReviewDb db,
    @Assisted PersonIdent i,
    @Assisted TestRepository<?> testRepo)
    throws Exception {
  this(
      notesFactory,
      approvalsUtil,
      queryProvider,
      notesMigration,
      db,
      i,
      testRepo,
      SUBJECT,
      FILE_NAME,
      FILE_CONTENT);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:23,代码来源:PushOneCommit.java

示例2: assign

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@Option(
  name = "--label",
  aliases = {"-l"},
  metaVar = "LABEL+VALUE",
  usage = "label(s) to assign (defaults to +1 if no value provided"
)
void addLabel(String token) throws CmdLineException {
  LabelVote v = LabelVote.parse(token);
  try {
    LabelType.checkName(v.label());
    ApprovalsUtil.checkLabel(labelTypes, v.label(), v.value());
  } catch (BadRequestException e) {
    throw clp.reject(e.getMessage());
  }
  labels.put(v.label(), v.value());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:17,代码来源:ReceiveCommits.java

示例3: MergeUtil

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@AssistedInject
MergeUtil(
    @GerritServerConfig Config serverConfig,
    Provider<ReviewDb> db,
    IdentifiedUser.GenericFactory identifiedUserFactory,
    @CanonicalWebUrl @Nullable Provider<String> urlProvider,
    ApprovalsUtil approvalsUtil,
    PluggableCommitMessageGenerator commitMessageGenerator,
    @Assisted ProjectState project) {
  this(
      serverConfig,
      db,
      identifiedUserFactory,
      urlProvider,
      approvalsUtil,
      project,
      commitMessageGenerator,
      project.isUseContentMerge());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:MergeUtil.java

示例4: EventFactory

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@Inject
EventFactory(
    AccountCache accountCache,
    Emails emails,
    @CanonicalWebUrl @Nullable Provider<String> urlProvider,
    PatchListCache patchListCache,
    @GerritPersonIdent PersonIdent myIdent,
    ChangeData.Factory changeDataFactory,
    ApprovalsUtil approvalsUtil,
    ChangeKindCache changeKindCache,
    Provider<InternalChangeQuery> queryProvider,
    SchemaFactory<ReviewDb> schema) {
  this.accountCache = accountCache;
  this.emails = emails;
  this.urlProvider = urlProvider;
  this.patchListCache = patchListCache;
  this.myIdent = myIdent;
  this.changeDataFactory = changeDataFactory;
  this.approvalsUtil = approvalsUtil;
  this.changeKindCache = changeKindCache;
  this.queryProvider = queryProvider;
  this.schema = schema;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:24,代码来源:EventFactory.java

示例5: DeleteVote

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@Inject
DeleteVote(
    Provider<ReviewDb> db,
    RetryHelper retryHelper,
    ApprovalsUtil approvalsUtil,
    PatchSetUtil psUtil,
    ChangeMessagesUtil cmUtil,
    IdentifiedUser.GenericFactory userFactory,
    VoteDeleted voteDeleted,
    DeleteVoteSender.Factory deleteVoteSenderFactory,
    NotifyUtil notifyUtil,
    RemoveReviewerControl removeReviewerControl,
    ProjectCache projectCache) {
  super(retryHelper);
  this.db = db;
  this.approvalsUtil = approvalsUtil;
  this.psUtil = psUtil;
  this.cmUtil = cmUtil;
  this.userFactory = userFactory;
  this.voteDeleted = voteDeleted;
  this.deleteVoteSenderFactory = deleteVoteSenderFactory;
  this.notifyUtil = notifyUtil;
  this.removeReviewerControl = removeReviewerControl;
  this.projectCache = projectCache;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:26,代码来源:DeleteVote.java

示例6: ChangeResource

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@Inject
ChangeResource(
    Provider<ReviewDb> db,
    AccountCache accountCache,
    ApprovalsUtil approvalUtil,
    PatchSetUtil patchSetUtil,
    PermissionBackend permissionBackend,
    StarredChangesUtil starredChangesUtil,
    ProjectCache projectCache,
    @Assisted ChangeNotes notes,
    @Assisted CurrentUser user) {
  this.db = db;
  this.accountCache = accountCache;
  this.approvalUtil = approvalUtil;
  this.patchSetUtil = patchSetUtil;
  this.permissionBackend = permissionBackend;
  this.starredChangesUtil = starredChangesUtil;
  this.projectCache = projectCache;
  this.notes = notes;
  this.user = user;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:22,代码来源:ChangeResource.java

示例7: Move

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@Inject
Move(
    PermissionBackend permissionBackend,
    Provider<ReviewDb> dbProvider,
    ChangeJson.Factory json,
    GitRepositoryManager repoManager,
    Provider<InternalChangeQuery> queryProvider,
    ChangeMessagesUtil cmUtil,
    RetryHelper retryHelper,
    PatchSetUtil psUtil,
    ApprovalsUtil approvalsUtil,
    ProjectCache projectCache,
    Provider<CurrentUser> userProvider) {
  super(retryHelper);
  this.permissionBackend = permissionBackend;
  this.dbProvider = dbProvider;
  this.json = json;
  this.repoManager = repoManager;
  this.queryProvider = queryProvider;
  this.cmUtil = cmUtil;
  this.psUtil = psUtil;
  this.approvalsUtil = approvalsUtil;
  this.projectCache = projectCache;
  this.userProvider = userProvider;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:26,代码来源:Move.java

示例8: Factory

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@Inject
Factory(
    ChangeData.Factory changeDataFactory,
    ChangeNotes.Factory notesFactory,
    ApprovalsUtil approvalsUtil,
    PatchSetUtil patchSetUtil) {
  this.changeDataFactory = changeDataFactory;
  this.notesFactory = notesFactory;
  this.approvalsUtil = approvalsUtil;
  this.patchSetUtil = patchSetUtil;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:12,代码来源:ChangeControl.java

示例9: ChangeControl

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
ChangeControl(
    ChangeData.Factory changeDataFactory,
    ApprovalsUtil approvalsUtil,
    RefControl refControl,
    ChangeNotes notes,
    PatchSetUtil patchSetUtil) {
  this.changeDataFactory = changeDataFactory;
  this.approvalsUtil = approvalsUtil;
  this.refControl = refControl;
  this.notes = notes;
  this.patchSetUtil = patchSetUtil;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:13,代码来源:ChangeControl.java

示例10: newInserter

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private ChangeInserter newInserter(Change.Id changeId, RevCommit commit) {
  return changeInserterFactory
      .create(changeId, commit, RefNames.REFS_CONFIG)
      .setMessage(
          // Same message as in ReceiveCommits.CreateRequest.
          ApprovalsUtil.renderMessageWithApprovals(1, ImmutableMap.of(), ImmutableMap.of()))
      .setValidate(false)
      .setUpdateRef(false);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:11,代码来源:CreateAccessChange.java

示例11: createChangeMessage

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
private ChangeMessage createChangeMessage(ChangeContext ctx, String reviewMessage)
    throws OrmException, IOException {
  String approvalMessage =
      ApprovalsUtil.renderMessageWithApprovals(
          patchSetId.get(), approvals, scanLabels(ctx, approvals));
  String kindMessage = changeKindMessage(changeKind);
  StringBuilder message = new StringBuilder(approvalMessage);
  if (!Strings.isNullOrEmpty(kindMessage)) {
    message.append(kindMessage);
  } else {
    message.append('.');
  }
  if (comments.size() == 1) {
    message.append("\n\n(1 comment)");
  } else if (comments.size() > 1) {
    message.append(String.format("\n\n(%d comments)", comments.size()));
  }
  if (!Strings.isNullOrEmpty(reviewMessage)) {
    message.append("\n\n").append(reviewMessage);
  }
  boolean workInProgress = ctx.getChange().isWorkInProgress();
  if (magicBranch != null && magicBranch.workInProgress) {
    workInProgress = true;
  }
  return ChangeMessagesUtil.newMessage(
      patchSetId,
      ctx.getUser(),
      ctx.getWhen(),
      message.toString(),
      ChangeMessagesUtil.uploadedPatchSetTag(workInProgress));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:32,代码来源:ReplaceOp.java

示例12: approve

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
private LabelNormalizer.Result approve(ChangeContext ctx, ChangeUpdate update)
    throws OrmException, IOException {
  PatchSet.Id psId = update.getPatchSetId();
  Map<PatchSetApproval.Key, PatchSetApproval> byKey = new HashMap<>();
  for (PatchSetApproval psa :
      args.approvalsUtil.byPatchSet(
          ctx.getDb(),
          ctx.getNotes(),
          ctx.getUser(),
          psId,
          ctx.getRevWalk(),
          ctx.getRepoView().getConfig())) {
    byKey.put(psa.getKey(), psa);
  }

  submitter =
      ApprovalsUtil.newApproval(psId, ctx.getUser(), LabelId.legacySubmit(), 1, ctx.getWhen());
  byKey.put(submitter.getKey(), submitter);

  // Flatten out existing approvals for this patch set based upon the current
  // permissions. Once the change is closed the approvals are not updated at
  // presentation view time, except for zero votes used to indicate a reviewer
  // was added. So we need to make sure votes are accurate now. This way if
  // permissions get modified in the future, historical records stay accurate.
  LabelNormalizer.Result normalized =
      args.labelNormalizer.normalize(ctx.getNotes(), ctx.getUser(), byKey.values());
  update.putApproval(submitter.getLabel(), submitter.getValue());
  saveApprovals(normalized, ctx, update, false);
  return normalized;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:31,代码来源:SubmitStrategyOp.java

示例13: MailProcessor

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@Inject
public MailProcessor(
    Emails emails,
    RetryHelper retryHelper,
    ChangeMessagesUtil changeMessagesUtil,
    CommentsUtil commentsUtil,
    OneOffRequestContext oneOffRequestContext,
    PatchListCache patchListCache,
    PatchSetUtil psUtil,
    Provider<InternalChangeQuery> queryProvider,
    DynamicMap<MailFilter> mailFilters,
    EmailReviewComments.Factory outgoingMailFactory,
    ApprovalsUtil approvalsUtil,
    CommentAdded commentAdded,
    AccountCache accountCache,
    @CanonicalWebUrl Provider<String> canonicalUrl) {
  this.emails = emails;
  this.retryHelper = retryHelper;
  this.changeMessagesUtil = changeMessagesUtil;
  this.commentsUtil = commentsUtil;
  this.oneOffRequestContext = oneOffRequestContext;
  this.patchListCache = patchListCache;
  this.psUtil = psUtil;
  this.queryProvider = queryProvider;
  this.mailFilters = mailFilters;
  this.outgoingMailFactory = outgoingMailFactory;
  this.commentAdded = commentAdded;
  this.approvalsUtil = approvalsUtil;
  this.accountCache = accountCache;
  this.canonicalUrl = canonicalUrl;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:32,代码来源:MailProcessor.java

示例14: ListReviewers

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@Inject
ListReviewers(
    Provider<ReviewDb> dbProvider,
    ApprovalsUtil approvalsUtil,
    ReviewerResource.Factory resourceFactory,
    ReviewerJson json) {
  this.dbProvider = dbProvider;
  this.approvalsUtil = approvalsUtil;
  this.resourceFactory = resourceFactory;
  this.json = json;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:12,代码来源:ListReviewers.java

示例15: RevisionReviewers

import com.google.gerrit.server.ApprovalsUtil; //导入依赖的package包/类
@Inject
RevisionReviewers(
    Provider<ReviewDb> dbProvider,
    ApprovalsUtil approvalsUtil,
    AccountsCollection accounts,
    ReviewerResource.Factory resourceFactory,
    DynamicMap<RestView<ReviewerResource>> views,
    ListRevisionReviewers list) {
  this.dbProvider = dbProvider;
  this.approvalsUtil = approvalsUtil;
  this.accounts = accounts;
  this.resourceFactory = resourceFactory;
  this.views = views;
  this.list = list;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:16,代码来源:RevisionReviewers.java


注:本文中的com.google.gerrit.server.ApprovalsUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。