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


Java Id类代码示例

本文整理汇总了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;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:15,代码来源:TestChangeRebuilderWrapper.java

示例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;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:13,代码来源:TestChangeRebuilderWrapper.java

示例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);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:9,代码来源:TestChangeRebuilderWrapper.java

示例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);
}
 
开发者ID:GerritCodeReview,项目名称:plugins_github,代码行数:11,代码来源:PullRequestImportJob.java

示例5: delete

import com.google.gerrit.reviewdb.client.Change.Id; //导入依赖的package包/类
@Override
public void delete(Id key) throws IOException {
  // do nothing
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:5,代码来源:ReadOnlyChangeIndex.java

示例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);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:6,代码来源:TestChangeRebuilderWrapper.java

示例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);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:7,代码来源:TestChangeRebuilderWrapper.java

示例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));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:5,代码来源:ElasticChangeIndex.java

示例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;
  }
}
 
开发者ID:GerritCodeReview,项目名称:plugins_github,代码行数:44,代码来源:PullRequestImportJob.java


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