public static ArrayMemory valueOf(MergeResult call) { ArrayMemory memory = new ArrayMemory(); memory.refOfIndex("base").assign(valueOf(call.getBase())); memory.refOfIndex("newHead").assign(valueOf(call.getNewHead())); memory.refOfIndex("status").assign(call.getMergeStatus().name()); memory.refOfIndex("success").assign(call.getMergeStatus().isSuccessful()); memory.refOfIndex("checkoutConflicts").assign(ArrayMemory.ofStringCollection(call.getCheckoutConflicts())); return memory; }
/** * @param parentShell * @param repository * @param mergeResult * @return the created dialog */ public static Dialog getDialog(Shell parentShell, Repository repository, MergeResult mergeResult) { if(mergeResult.getMergeStatus() == MergeStatus.CHECKOUT_CONFLICT) return new CheckoutConflictDialog(parentShell, repository, mergeResult.getCheckoutConflicts()); else return new MergeResultDialog(parentShell, repository, mergeResult); }
private Future<Void> update() { Future<Void> result = Future.future(); vertx.executeBlocking( future -> { PullResult call; try { call = git.pull().setRemote(remote).setRemoteBranchName(branch).call(); } catch (GitAPIException e) { future.fail(e); return; } if (call.isSuccessful()) { future.complete(); } else { if (call.getMergeResult() != null) { future.fail("Unable to merge repository - Conflicts: " + call.getMergeResult().getCheckoutConflicts()); } else { future.fail("Unable to rebase repository - Conflicts: " + call.getRebaseResult().getConflicts()); } } }, result.completer() ); return result; }
private Future<Void> update() { Future<Void> result = Future.future(); vertx.executeBlocking( future -> { PullResult call; try { call = git.pull().setRemote(remote).setRemoteBranchName(branch).call(); } catch (GitAPIException e) { future.fail(e); return; } if (call.isSuccessful()) { future.complete(); } else { if (call.getMergeResult() != null) { future.fail("Unable to merge repository - Conflicts: " + call.getMergeResult().getCheckoutConflicts()); } else { future.fail("Unable to rebase repository - Conflicts: " + call.getRebaseResult().getConflicts()); } } }, result.completer() ); return result; }
case CHECKOUT_CONFLICT: outw.println(CLIText.get().mergeCheckoutConflict); for (String collidingPath : result.getCheckoutConflicts()) outw.println("\t" + collidingPath); //$NON-NLS-1$ outw.println(CLIText.get().mergeCheckoutFailed);