public static ArrayMemory valueOf(RemoteRefUpdate value) { ArrayMemory memory = new ArrayMemory(); memory.refOfIndex("message").assign(value.getMessage()); memory.refOfIndex("remoteName").assign(value.getRemoteName()); memory.refOfIndex("srcRef").assign(value.getSrcRef()); memory.refOfIndex("expectedOldObjectId").assign(valueOf(value.getExpectedOldObjectId())); memory.refOfIndex("newObjectId").assign(valueOf(value.getNewObjectId())); memory.refOfIndex("delete").assign(value.isDelete()); memory.refOfIndex("fastForward").assign(value.isFastForward()); memory.refOfIndex("forceUpdate").assign(value.isForceUpdate()); return memory; }
/** * Set Refs * * @param toRefs * a collection of {@code RemoteRefUpdate}s */ public void setRefs(Collection<RemoteRefUpdate> toRefs) { StringBuilder b = new StringBuilder(); for (RemoteRefUpdate u : toRefs) { b.append(u.getSrcRef()); b.append(" "); //$NON-NLS-1$ b.append(u.getNewObjectId().getName()); b.append(" "); //$NON-NLS-1$ b.append(u.getRemoteName()); b.append(" "); //$NON-NLS-1$ ObjectId ooid = u.getExpectedOldObjectId(); b.append((ooid == null) ? ObjectId.zeroId().getName() : ooid .getName()); b.append("\n"); //$NON-NLS-1$ } refs = b.toString(); } }
String getSrcRefName() { return update.getSrcRef(); }
public void logPushResult(Iterable<PushResult> results, Repository repository, boolean verbose) throws IOException { String local = repository.getDirectory().getCanonicalPath(); for (PushResult result : results) { Map<String, RemoteRefUpdate> map = new TreeMap<>(); for (RemoteRefUpdate update : result.getRemoteUpdates()) { if (verbose || update.getStatus() != RemoteRefUpdate.Status.UP_TO_DATE) { map.put(update.getSrcRef(), update); } } if (map.size() > 0) { LOG.info(String.format("Pushed from %s to %s:", local, result.getURI())); for (RemoteRefUpdate update : map.values()) { LOG.info(String.format(" - %s (%s)", update.getSrcRef(), update.getStatus())); } } else { LOG.info(String.format("Pushed from %s to %s - no reference was updated", local, result.getURI())); } } }
@Override public void logPushResult(Iterable<PushResult> results, Repository repository, boolean verbose) throws IOException { String local = repository.getDirectory().getCanonicalPath(); for (PushResult result : results) { Map<String, RemoteRefUpdate> map = new TreeMap<>(); for (RemoteRefUpdate update : result.getRemoteUpdates()) { if (verbose || update.getStatus() != RemoteRefUpdate.Status.UP_TO_DATE) { map.put(update.getSrcRef(), update); } } if (map.size() > 0) { Activator.log(LogService.LOG_INFO, String.format("Pushed from %s to %s:", local, result.getURI())); for (RemoteRefUpdate update : map.values()) { Activator.log(LogService.LOG_INFO, String.format(" - %s (%s)", update.getSrcRef(), update.getStatus())); } } else { Activator.log(LogService.LOG_INFO, String.format("Pushed from %s to %s - no reference was updated", local, result.getURI())); } } }
@Override public void logPushResult(Iterable<PushResult> results, Repository repository, boolean verbose) throws IOException { String local = repository.getDirectory().getCanonicalPath(); for (PushResult result : results) { Map<String, RemoteRefUpdate> map = new TreeMap<>(); for (RemoteRefUpdate update : result.getRemoteUpdates()) { if (verbose || update.getStatus() != RemoteRefUpdate.Status.UP_TO_DATE) { map.put(update.getSrcRef(), update); } } if (map.size() > 0) { Activator.log(LogService.LOG_INFO, String.format("Pushed from %s to %s:", local, result.getURI())); for (RemoteRefUpdate update : map.values()) { Activator.log(LogService.LOG_INFO, String.format(" - %s (%s)", update.getSrcRef(), update.getStatus())); } } else { Activator.log(LogService.LOG_INFO, String.format("Pushed from %s to %s - no reference was updated", local, result.getURI())); } } }
/** * @param toRefs */ public void setRefs(Collection<RemoteRefUpdate> toRefs) { StringBuilder b = new StringBuilder(); boolean first = true; for (RemoteRefUpdate u : toRefs) { if (!first) b.append("\n"); //$NON-NLS-1$ else first = false; b.append(u.getSrcRef()); b.append(" "); //$NON-NLS-1$ b.append(u.getNewObjectId().getName()); b.append(" "); //$NON-NLS-1$ b.append(u.getRemoteName()); b.append(" "); //$NON-NLS-1$ ObjectId ooid = u.getExpectedOldObjectId(); b.append((ooid == null) ? ObjectId.zeroId().getName() : ooid .getName()); } refs = b.toString(); } }
/** * Set Refs * * @param toRefs * a collection of {@code RemoteRefUpdate}s */ public void setRefs(Collection<RemoteRefUpdate> toRefs) { StringBuilder b = new StringBuilder(); for (RemoteRefUpdate u : toRefs) { b.append(u.getSrcRef()); b.append(" "); //$NON-NLS-1$ b.append(u.getNewObjectId().getName()); b.append(" "); //$NON-NLS-1$ b.append(u.getRemoteName()); b.append(" "); //$NON-NLS-1$ ObjectId ooid = u.getExpectedOldObjectId(); b.append((ooid == null) ? ObjectId.zeroId().getName() : ooid .getName()); b.append("\n"); //$NON-NLS-1$ } refs = b.toString(); } }
? refUpdate.getNewObjectId() : refUpdate.getTrackingRefUpdate().getNewObjectId(); if (status == Status.OK) { acceptedUpdates.put(refUpdate.getSrcRef(), new RemoteBranchChange(refUpdate.getSrcRef(), refUpdate) .updated(from, to, "fast-forward")); } else if (status == Status.UP_TO_DATE) { acceptedUpdates.put(refUpdate.getSrcRef(), new RemoteBranchChange(refUpdate.getSrcRef(), refUpdate)); } else { switch (status) { case REJECTED_NONFASTFORWARD: rejectedUpdates.put(refUpdate.getSrcRef(), new RemoteBranchChange(refUpdate.getSrcRef(), refUpdate) .rejected(from, to, "non fast-forward update")); break; default: rejectedUpdates.put(refUpdate.getSrcRef(), new RemoteBranchChange(refUpdate.getSrcRef(), refUpdate) .rejected(from, to, status.toString())); break;
case REJECTED_OTHER_REASON : throw new RepositoryClientException( "could not update ref ".concat(refUpdate.getSrcRef()).concat( " status ".concat(refUpdate.getStatus().toString())));
final String srcRef = rru.isDelete() ? null : rru.getSrcRef();