Search in sources :

Example 11 with AbstractVcs

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));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Project(com.intellij.openapi.project.Project) AbstractVcs(com.intellij.openapi.vcs.AbstractVcs)

Example 12 with AbstractVcs

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);
}
Also used : AbstractVcs(com.intellij.openapi.vcs.AbstractVcs)

Example 13 with AbstractVcs

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);
}
Also used : AbstractVcs(com.intellij.openapi.vcs.AbstractVcs)

Example 14 with AbstractVcs

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));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VcsFileRevision(com.intellij.openapi.vcs.history.VcsFileRevision) AbstractVcs(com.intellij.openapi.vcs.AbstractVcs)

Example 15 with AbstractVcs

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();
        }
    }
}
Also used : ProjectLevelVcsManager(com.intellij.openapi.vcs.ProjectLevelVcsManager) AbstractVcs(com.intellij.openapi.vcs.AbstractVcs)

Aggregations

AbstractVcs (com.intellij.openapi.vcs.AbstractVcs)44 VirtualFile (com.intellij.openapi.vfs.VirtualFile)22 NotNull (org.jetbrains.annotations.NotNull)12 Project (com.intellij.openapi.project.Project)9 FilePath (com.intellij.openapi.vcs.FilePath)7 VcsRoot (com.intellij.openapi.vcs.VcsRoot)7 ProjectLevelVcsManager (com.intellij.openapi.vcs.ProjectLevelVcsManager)6 Nullable (org.jetbrains.annotations.Nullable)5 Module (com.intellij.openapi.module.Module)3 VcsDirectoryMapping (com.intellij.openapi.vcs.VcsDirectoryMapping)3 VcsKey (com.intellij.openapi.vcs.VcsKey)3 VcsFileRevision (com.intellij.openapi.vcs.history.VcsFileRevision)3 VcsHistoryProvider (com.intellij.openapi.vcs.history.VcsHistoryProvider)3 VcsRevisionNumber (com.intellij.openapi.vcs.history.VcsRevisionNumber)3 Date (java.util.Date)3 Pair (com.intellij.openapi.util.Pair)2 VcsException (com.intellij.openapi.vcs.VcsException)2 DiffProvider (com.intellij.openapi.vcs.diff.DiffProvider)2 VcsHistorySession (com.intellij.openapi.vcs.history.VcsHistorySession)2 VcsLogProvider (com.intellij.vcs.log.VcsLogProvider)2