use of com.intellij.openapi.vcs.AbstractVcs in project intellij-community by JetBrains.
the class ShowBaseRevisionAction method actionPerformed.
@Override
protected void actionPerformed(@NotNull VcsContext vcsContext) {
Project project = assertNotNull(vcsContext.getProject());
VirtualFile file = vcsContext.getSelectedFiles()[0];
AbstractVcs vcs = assertNotNull(ChangesUtil.getVcsForFile(file, project));
ProgressManager.getInstance().run(new MyTask(file, vcs, vcsContext));
}
use of com.intellij.openapi.vcs.AbstractVcs in project intellij-community by JetBrains.
the class TabbedShowHistoryAction method isEnabled.
private static boolean isEnabled(@NotNull Project project, @NotNull FilePath path, @NotNull VirtualFile fileOrParent) {
boolean fileInVcs = AbstractVcs.fileInVcsByFileStatus(project, fileOrParent);
if (!fileInVcs)
return false;
AbstractVcs vcs = ChangesUtil.getVcsForFile(fileOrParent, project);
if (vcs == null)
return false;
return canShowNewFileHistory(project, path) || canShowOldFileHistory(vcs, path, fileOrParent);
}
use of com.intellij.openapi.vcs.AbstractVcs in project intellij-community by JetBrains.
the class IgnoredFilesCompositeHolder method containsFile.
@Override
public boolean containsFile(VirtualFile file) {
if (myIdeIgnoredFilesHolder.containsFile(file))
return true;
final AbstractVcs vcs = myVcsManager.getVcsFor(file);
if (vcs == null)
return false;
final IgnoredFilesHolder ignoredFilesHolder = myVcsIgnoredHolderMap.get(vcs);
return ignoredFilesHolder != null && ignoredFilesHolder.containsFile(file);
}
use of com.intellij.openapi.vcs.AbstractVcs in project intellij-community by JetBrains.
the class AnnotateRevisionActionBase method actionPerformed.
@Override
public void actionPerformed(@NotNull final AnActionEvent e) {
final VcsFileRevision fileRevision = getFileRevision(e);
final VirtualFile file = getFile(e);
final AbstractVcs vcs = getVcs(e);
annotate(notNull(file), notNull(fileRevision), notNull(vcs), getEditor(e), getAnnotatedLine(e));
}
use of com.intellij.openapi.vcs.AbstractVcs in project intellij-community by JetBrains.
the class StartUseVcsAction method actionPerformed.
@Override
public void actionPerformed(final AnActionEvent e) {
final VcsDataWrapper data = new VcsDataWrapper(e);
final boolean enabled = data.enabled();
if (!enabled) {
return;
}
final StartUseVcsDialog dialog = new StartUseVcsDialog(data);
dialog.show();
if (dialog.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
final String vcsName = dialog.getVcs();
if (vcsName.length() > 0) {
final ProjectLevelVcsManager manager = data.getManager();
AbstractVcs vcs = manager.findVcsByName(vcsName);
assert vcs != null : "No vcs found for name " + vcsName;
vcs.enableIntegration();
}
}
}
Aggregations