本文整理汇总了Java中com.google.gerrit.reviewdb.client.Change.Id类的典型用法代码示例。如果您正苦于以下问题:Java Id类的具体用法?Java Id怎么用?Java Id使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Id类属于com.google.gerrit.reviewdb.client.Change包,在下文中一共展示了Id类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rebuild
import com.google.gerrit.reviewdb.client.Change.Id; //导入依赖的package包/类
private Result rebuild(ReviewDb db, Change.Id changeId, boolean checkReadOnly)
throws IOException, OrmException {
if (failNextUpdate.getAndSet(false)) {
throw new IOException("Update failed");
}
Result result =
checkReadOnly
? delegate.rebuild(db, changeId)
: delegate.rebuildEvenIfReadOnly(db, changeId);
if (stealNextUpdate.getAndSet(false)) {
throw new IOException("Update stolen");
}
return result;
}
示例2: execute
import com.google.gerrit.reviewdb.client.Change.Id; //导入依赖的package包/类
@Override
public Result execute(ReviewDb db, Change.Id changeId, NoteDbUpdateManager manager)
throws OrmException, IOException {
if (failNextUpdate.getAndSet(false)) {
throw new IOException("Update failed");
}
Result result = delegate.execute(db, changeId, manager);
if (stealNextUpdate.getAndSet(false)) {
throw new IOException("Update stolen");
}
return result;
}
示例3: rebuildReviewDb
import com.google.gerrit.reviewdb.client.Change.Id; //导入依赖的package包/类
@Override
public void rebuildReviewDb(ReviewDb db, Project.NameKey project, Id changeId)
throws OrmException {
if (failNextUpdate.getAndSet(false)) {
throw new OrmException("Update failed");
}
delegate.rebuildReviewDb(db, project, changeId);
}
示例4: getOrRegisterAccount
import com.google.gerrit.reviewdb.client.Change.Id; //导入依赖的package包/类
private com.google.gerrit.reviewdb.client.Account.Id getOrRegisterAccount(
ReviewDb db, String login, String name, String email)
throws OrmException, BadRequestException, ResourceConflictException,
UnprocessableEntityException, IOException, ConfigInvalidException {
Optional<ExternalId> gerritId = externalIdByScheme(ExternalId.SCHEME_GERRIT, login);
if (gerritId.isPresent()) {
return gerritId.get().accountId();
}
return accountImporter.importAccount(login, name, email);
}
示例5: delete
import com.google.gerrit.reviewdb.client.Change.Id; //导入依赖的package包/类
@Override
public void delete(Id key) throws IOException {
// do nothing
}
示例6: rebuildEvenIfReadOnly
import com.google.gerrit.reviewdb.client.Change.Id; //导入依赖的package包/类
@Override
public Result rebuildEvenIfReadOnly(ReviewDb db, Change.Id changeId)
throws IOException, OrmException {
return rebuild(db, changeId, false);
}
示例7: stage
import com.google.gerrit.reviewdb.client.Change.Id; //导入依赖的package包/类
@Override
public NoteDbUpdateManager stage(ReviewDb db, Change.Id changeId)
throws IOException, OrmException {
// Don't inspect stealNextUpdate; that happens in execute() below.
return delegate.stage(db, changeId);
}
示例8: addActions
import com.google.gerrit.reviewdb.client.Change.Id; //导入依赖的package包/类
@Override
protected Builder addActions(Builder builder, Id c) {
return builder.addAction(delete(OPEN_CHANGES, c)).addAction(delete(OPEN_CHANGES, c));
}
示例9: addPullRequestToChange
import com.google.gerrit.reviewdb.client.Change.Id; //导入依赖的package包/类
private List<Id> addPullRequestToChange(ReviewDb db, GHPullRequest pr, Repository gitRepo)
throws Exception {
String destinationBranch = REFS_HEADS + pr.getBase().getRef();
List<Id> prChanges = Lists.newArrayList();
ObjectId baseObjectId = ObjectId.fromString(pr.getBase().getSha());
ObjectId prHeadObjectId = ObjectId.fromString(pr.getHead().getSha());
try (RevWalk walk = new RevWalk(gitRepo)) {
walk.markUninteresting(walk.lookupCommit(baseObjectId));
walk.markStart(walk.lookupCommit(prHeadObjectId));
walk.sort(RevSort.REVERSE);
int patchNr = 1;
for (GHPullRequestCommitDetail ghCommitDetail : pr.listCommits()) {
status.update(
Code.SYNC,
"Patch #" + patchNr,
"Patch#" + patchNr + ": Inserting PullRequest into Gerrit");
RevCommit revCommit = walk.parseCommit(ObjectId.fromString(ghCommitDetail.getSha()));
GHUser prUser = pr.getUser();
GitUser commitAuthor = ghCommitDetail.getCommit().getAuthor();
GitHubUser gitHubUser = GitHubUser.from(prUser, commitAuthor);
Account.Id pullRequestOwner = getOrRegisterAccount(db, gitHubUser);
Id changeId =
createChange.addCommitToChange(
db,
project,
gitRepo,
destinationBranch,
pullRequestOwner,
revCommit,
getChangeMessage(pr),
String.format(TOPIC_FORMAT, new Integer(pr.getNumber())));
if (changeId != null) {
prChanges.add(changeId);
}
}
return prChanges;
}
}