FileDocumentManager.getInstance().saveAllDocuments();
}
});
final VirtualFile[] vFiles = getVirtualFiles(event);
final MksVcs mksvcs = MksVcs.getInstance(project);
if (!ProjectLevelVcsManager.getInstance(project).checkAllFilesAreUnder(mksvcs, vFiles)) {
return;
}
final List<VcsException> exceptions = new ArrayList<VcsException>();
ApplicationManager.getApplication().runWriteAction(new Runnable() {
public void run() {
final VirtualFile[] affectedFiles = collectAffectedFiles(project, vFiles);
//noinspection unchecked
perform(project, mksvcs, exceptions, affectedFiles);
for (VirtualFile file : affectedFiles) {
file.refresh(false, true);
FileStatusManager.getInstance(project).fileStatusChanged(file);
}
}
});
mksvcs.showErrors(exceptions, getActionName(mksvcs));
}