本文整理汇总了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);
}
示例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());
}
示例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());
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}