private boolean merge(boolean mergeDialogInvokedFromNotification) {
    try {
      Collection<VirtualFile> initiallyUnmergedFiles = getUnmergedFiles(myProject, myRoots);
      if (initiallyUnmergedFiles.isEmpty()) {
        LOG.info("merge: no unmerged files");
        return mergeDialogInvokedFromNotification || proceedIfNothingToMerge();
      }

      showMergeDialog(initiallyUnmergedFiles);

      Collection<VirtualFile> unmergedFilesAfterResolve = getUnmergedFiles(myProject, myRoots);
      if (unmergedFilesAfterResolve.isEmpty()) {
        LOG.info("merge no more unmerged files");
        return mergeDialogInvokedFromNotification || proceedAfterAllMerged();
      }

      LOG.info("mergeFiles unmerged files remain: " + unmergedFilesAfterResolve);
      if (mergeDialogInvokedFromNotification) {
        notifyUnresolvedRemainAfterNotification();
      }
      else {
        notifyUnresolvedRemain();
      }
      return false;
    }
    catch (VcsException e) {
      notifyException(e);
      return false;
    }
  }
private boolean merge(boolean mergeDialogInvokedFromNotification)