Search in sources :

Example 1 with VcsRepositoryManager

use of com.intellij.dvcs.repo.VcsRepositoryManager in project intellij-community by JetBrains.

the class VcsRepositoryManagerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    cd(myProjectRoot);
    myVcs = new MockAbstractVcs(myProject);
    myProjectLevelVcsManager = (ProjectLevelVcsManagerImpl) ProjectLevelVcsManager.getInstance(myProject);
    myProjectLevelVcsManager.registerVcs(myVcs);
    READY_TO_READ = new CountDownLatch(1);
    CONTINUE_MODIFY = new CountDownLatch(1);
    myMockCreator = createMockRepositoryCreator();
    ExtensionPoint<VcsRepositoryCreator> point = getExtensionPoint();
    point.registerExtension(myMockCreator);
    myGlobalRepositoryManager = new VcsRepositoryManager(myProject, myProjectLevelVcsManager);
    myGlobalRepositoryManager.initComponent();
}
Also used : MockAbstractVcs(com.intellij.openapi.vcs.changes.committed.MockAbstractVcs) VcsRepositoryCreator(com.intellij.dvcs.repo.VcsRepositoryCreator) VcsRepositoryManager(com.intellij.dvcs.repo.VcsRepositoryManager) CountDownLatch(java.util.concurrent.CountDownLatch)

Example 2 with VcsRepositoryManager

use of com.intellij.dvcs.repo.VcsRepositoryManager in project intellij-community by JetBrains.

the class VcsPushAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
    Project project = e.getRequiredData(CommonDataKeys.PROJECT);
    VcsRepositoryManager manager = VcsRepositoryManager.getInstance(project);
    Collection<Repository> repositories = e.getData(CommonDataKeys.EDITOR) != null ? ContainerUtil.<Repository>emptyList() : collectRepositories(manager, e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY));
    VirtualFile selectedFile = DvcsUtil.getSelectedFile(project);
    new VcsPushDialog(project, DvcsUtil.sortRepositories(repositories), selectedFile != null ? manager.getRepositoryForFile(selectedFile) : null).show();
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Project(com.intellij.openapi.project.Project) Repository(com.intellij.dvcs.repo.Repository) VcsPushDialog(com.intellij.dvcs.push.ui.VcsPushDialog) VcsRepositoryManager(com.intellij.dvcs.repo.VcsRepositoryManager)

Aggregations

VcsRepositoryManager (com.intellij.dvcs.repo.VcsRepositoryManager)2 VcsPushDialog (com.intellij.dvcs.push.ui.VcsPushDialog)1 Repository (com.intellij.dvcs.repo.Repository)1 VcsRepositoryCreator (com.intellij.dvcs.repo.VcsRepositoryCreator)1 Project (com.intellij.openapi.project.Project)1 MockAbstractVcs (com.intellij.openapi.vcs.changes.committed.MockAbstractVcs)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 CountDownLatch (java.util.concurrent.CountDownLatch)1