use of com.intellij.openapi.vcs.TransactionRunnable in project intellij-community by JetBrains.
the class HgAbstractFilesAction method actionPerformed.
public final void actionPerformed(AnActionEvent event) {
final DataContext dataContext = event.getDataContext();
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
final VirtualFile[] files = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(dataContext);
if (project == null || files == null || files.length == 0) {
return;
}
project.save();
final HgVcs vcs = HgVcs.getInstance(project);
if ((vcs == null) || !ProjectLevelVcsManager.getInstance(project).checkAllFilesAreUnder(vcs, files)) {
return;
}
final AbstractVcsHelper helper = AbstractVcsHelper.getInstance(project);
List<VcsException> exceptions = helper.runTransactionRunnable(vcs, new TransactionRunnable() {
public void run(List<VcsException> exceptions) {
try {
execute(project, vcs, files, dataContext);
} catch (VcsException ex) {
exceptions.add(ex);
}
}
}, null);
helper.showErrors(exceptions, vcs.getName());
}
Aggregations