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


Java RemoteRefUpdate.Status方法代码示例

本文整理汇总了Java中org.eclipse.jgit.transport.RemoteRefUpdate.Status方法的典型用法代码示例。如果您正苦于以下问题:Java RemoteRefUpdate.Status方法的具体用法?Java RemoteRefUpdate.Status怎么用?Java RemoteRefUpdate.Status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jgit.transport.RemoteRefUpdate的用法示例。


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

示例1: deleteRemoteBranch

import org.eclipse.jgit.transport.RemoteRefUpdate; //导入方法依赖的package包/类
/**
 * Deletes a remote branch. Essentially a 'git push <remote> :<remote branch name>'
 *
 * @param branchHelper the remote branch to delete
 * @return the status of the push to remote to delete
 * @throws GitAPIException
 */
public RemoteRefUpdate.Status deleteRemoteBranch(RemoteBranchHelper branchHelper) throws GitAPIException, IOException {
    PushCommand pushCommand = new Git(this.repoHelper.repo).push();
    // We're deleting the branch on a remote, so there it shows up as refs/heads/<branchname>
    // instead of what it shows up on local: refs/<remote>/<branchname>, so we manually enter
    // this thing in here
    pushCommand.setRemote("origin").add(":refs/heads/"+branchHelper.parseBranchName());
    this.repoHelper.myWrapAuthentication(pushCommand);

    // Update the remote branches in case it worked
    updateRemoteBranches();

    boolean succeeded=false;
    for (PushResult result : pushCommand.call()) {
        for (RemoteRefUpdate refUpdate : result.getRemoteUpdates()) {
            return refUpdate.getStatus();
        }
    }
    return null;
}
 
开发者ID:dmusican,项目名称:Elegit,代码行数:27,代码来源:BranchModel.java

示例2: postReplicationFailedEvent

import org.eclipse.jgit.transport.RemoteRefUpdate; //导入方法依赖的package包/类
private void postReplicationFailedEvent(PushOne pushOp, RemoteRefUpdate.Status status) {
  Project.NameKey project = pushOp.getProjectNameKey();
  String targetNode = resolveNodeName(pushOp.getURI());
  for (String ref : pushOp.getRefs()) {
    RefReplicatedEvent event =
        new RefReplicatedEvent(project.get(), ref, targetNode, RefPushResult.FAILED, status);
    try {
      eventDispatcher.get().postEvent(new Branch.NameKey(project, ref), event);
    } catch (PermissionBackendException e) {
      repLog.error("error posting event", e);
    }
  }
}
 
开发者ID:GerritCodeReview,项目名称:plugins_replication,代码行数:14,代码来源:Destination.java

示例3: onRefReplicatedToOneNode

import org.eclipse.jgit.transport.RemoteRefUpdate; //导入方法依赖的package包/类
@Override
void onRefReplicatedToOneNode(
    String project,
    String ref,
    URIish uri,
    RefPushResult status,
    RemoteRefUpdate.Status refStatus) {
  StringBuilder sb = new StringBuilder();
  sb.append("Replicate ");
  sb.append(project);
  sb.append(" ref ");
  sb.append(ref);
  sb.append(" to ");
  sb.append(resolveNodeName(uri));
  sb.append(", ");
  switch (status) {
    case SUCCEEDED:
      sb.append("Succeeded!");
      break;
    case FAILED:
      sb.append("FAILED!");
      hasError.compareAndSet(false, true);
      break;
    case NOT_ATTEMPTED:
      sb.append("NOT ATTEMPTED!");
      break;
    default:
      sb.append("UNKNOWN RESULT!");
      break;
  }
  sb.append(" (");
  sb.append(refStatus.toString());
  sb.append(")");
  writeStdOut(sb.toString());
}
 
开发者ID:GerritCodeReview,项目名称:plugins_replication,代码行数:36,代码来源:PushResultProcessing.java

示例4: notifyRefReplicated

import org.eclipse.jgit.transport.RemoteRefUpdate; //导入方法依赖的package包/类
public void notifyRefReplicated(
    String project,
    String ref,
    URIish uri,
    RefPushResult status,
    RemoteRefUpdate.Status refUpdateStatus) {
  pushResultProcessing.onRefReplicatedToOneNode(project, ref, uri, status, refUpdateStatus);

  RefReplicationStatus completedRefStatus = null;
  boolean allPushTaksCompleted = false;
  countingLock.lock();
  try {
    RefReplicationStatus refStatus = getRefStatus(project, ref);
    refStatus.replicatedNodesCount++;
    finishedPushTasksCount++;

    if (allScheduled) {
      if (refStatus.allDone()) {
        completedRefStatus = statusByProjectRef.remove(project, ref);
      }
      allPushTaksCompleted = finishedPushTasksCount == totalPushTasksCount;
    }
  } finally {
    countingLock.unlock();
  }

  if (completedRefStatus != null) {
    doRefPushTasksCompleted(completedRefStatus);
  }

  if (allPushTaksCompleted) {
    doAllPushTasksCompleted();
  }
}
 
开发者ID:GerritCodeReview,项目名称:plugins_replication,代码行数:35,代码来源:ReplicationState.java

示例5: RefReplicatedEvent

import org.eclipse.jgit.transport.RemoteRefUpdate; //导入方法依赖的package包/类
public RefReplicatedEvent(
    String project,
    String ref,
    String targetNode,
    RefPushResult status,
    RemoteRefUpdate.Status refStatus) {
  super(TYPE);
  this.project = project;
  this.ref = ref;
  this.targetNode = targetNode;
  this.status = status.toString();
  this.refStatus = refStatus;
}
 
开发者ID:GerritCodeReview,项目名称:plugins_replication,代码行数:14,代码来源:RefReplicatedEvent.java

示例6: pushForReview

import org.eclipse.jgit.transport.RemoteRefUpdate; //导入方法依赖的package包/类
private static void pushForReview(
    TestRepository<?> testRepo, RemoteRefUpdate.Status expectedStatus, String expectedMessage)
    throws GitAPIException {
  String ref = "refs/for/master";
  PushResult r = pushHead(testRepo, ref);
  RemoteRefUpdate refUpdate = r.getRemoteUpdate(ref);
  assertThat(refUpdate.getStatus()).isEqualTo(expectedStatus);
  if (expectedMessage != null) {
    assertThat(refUpdate.getMessage()).contains(expectedMessage);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:12,代码来源:AbstractPushForReview.java

示例7: assertDeleteRef

import org.eclipse.jgit.transport.RemoteRefUpdate; //导入方法依赖的package包/类
private void assertDeleteRef(RemoteRefUpdate.Status expectedStatus) throws Exception {
  BranchInput in = new BranchInput();
  in.ref = "refs/heads/test";
  gApi.projects().name(project.get()).branch(in.ref).create(in);
  PushResult result = deleteRef(testRepo, in.ref);
  RemoteRefUpdate refUpdate = result.getRemoteUpdate(in.ref);
  assertThat(refUpdate.getStatus()).isEqualTo(expectedStatus);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:9,代码来源:ForcePushIT.java

示例8: validateRemoteRefUpdates

import org.eclipse.jgit.transport.RemoteRefUpdate; //导入方法依赖的package包/类
/**
 * Check references updates for any errors
 *
 * @param errorPrefix The error prefix for any error message
 * @param refUpdates A collection of remote references updates
 */
public static void validateRemoteRefUpdates(String errorPrefix, Collection<RemoteRefUpdate> refUpdates) {
        for (RemoteRefUpdate refUpdate : refUpdates) {
                RemoteRefUpdate.Status status = refUpdate.getStatus();

                if (status == RemoteRefUpdate.Status.REJECTED_NODELETE ||
                    status == RemoteRefUpdate.Status.NON_EXISTING ||
                    status == RemoteRefUpdate.Status.NOT_ATTEMPTED ||
                    status == RemoteRefUpdate.Status.REJECTED_NONFASTFORWARD ||
                    status == RemoteRefUpdate.Status.REJECTED_OTHER_REASON ||
                    status == RemoteRefUpdate.Status.REJECTED_REMOTE_CHANGED) {
                        throw new BuildException(String.format("%s - Status '%s'", errorPrefix, status.name()));
                }
        }
}
 
开发者ID:rimerosolutions,项目名称:ant-git-tasks,代码行数:21,代码来源:GitTaskUtils.java

示例9: testRemoteUpdateStatus

import org.eclipse.jgit.transport.RemoteRefUpdate; //导入方法依赖的package包/类
public void testRemoteUpdateStatus () {
    for (RemoteRefUpdate.Status status : RemoteRefUpdate.Status.values()) {
        assertNotNull(GitRefUpdateResult.valueOf(status.name()));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:GitEnumsStateTest.java


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