コード例 #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);
  }
コード例 #2
0
 public void invokeRefreshSvnRoots(final boolean asynchronous) {
   REFRESH_LOG.debug("refresh: ", new Throwable());
   if (myCopiesRefreshManager != null) {
     if (asynchronous) {
       myCopiesRefreshManager.getCopiesRefresh().asynchRequest();
     } else {
       if (ApplicationManager.getApplication().isDispatchThread()) {
         ProgressManager.getInstance()
             .runProcessWithProgressSynchronously(
                 new Runnable() {
                   @Override
                   public void run() {
                     myCopiesRefreshManager.getCopiesRefresh().synchRequest();
                   }
                 },
                 SvnBundle.message("refreshing.working.copies.roots.progress.text"),
                 true,
                 myProject);
       } else {
         myCopiesRefreshManager.getCopiesRefresh().synchRequest();
       }
     }
   }
 }