コード例 #1
0
  public void execute() {
    int ok =
        Messages.showOkCancelDialog(
            myVcs.getProject(),
            (myChange.isMoved()
                ? SvnBundle.message(
                    "confirmation.resolve.tree.conflict.merge.moved",
                    myOldPresentation,
                    myNewPresentation)
                : SvnBundle.message(
                    "confirmation.resolve.tree.conflict.merge.renamed",
                    myOldPresentation,
                    myNewPresentation)),
            TreeConflictRefreshablePanel.TITLE,
            Messages.getQuestionIcon());
    if (Messages.OK != ok) return;

    FileDocumentManager.getInstance().saveAllDocuments();
    // final String name = "Merge changes from theirs for: " + myOldPresentation;

    final Continuation fragmented = Continuation.createFragmented(myVcs.getProject(), false);
    fragmented.addExceptionHandler(
        VcsException.class,
        new Consumer<VcsException>() {
          @Override
          public void consume(VcsException e) {
            myWarnings.add(e);
            if (e.isWarning()) {
              return;
            }
            AbstractVcsHelper.getInstance(myVcs.getProject())
                .showErrors(myWarnings, TreeConflictRefreshablePanel.TITLE);
          }
        });

    final List<TaskDescriptor> tasks = new SmartList<TaskDescriptor>();
    tasks.add(
        myDescription.isDirectory()
            ? new PreloadChangesContentsForDir()
            : new PreloadChangesContentsForFile());
    tasks.add(new ConvertTextPaths());
    tasks.add(new PatchCreator());
    tasks.add(new SelectPatchesInApplyPatchDialog());
    tasks.add(new SelectBinaryFiles());

    fragmented.run(tasks);
  }