Search in sources :

Example 6 with IgnoredFileBean

use of com.intellij.openapi.vcs.changes.IgnoredFileBean in project intellij-community by JetBrains.

the class IgnoredFilesTest method testFileIsIgnored.

// they all blink now
@Test
public void testFileIsIgnored() throws Exception {
    final String filePath1 = myClientRoot.getPath() + "/a";
    final File file = new File(filePath1);
    file.createNewFile();
    final IgnoredFileBean ignoredFileBean = IgnoredBeanFactory.ignoreFile(filePath1, myProject);
    myChangeListManager.addFilesToIgnore(ignoredFileBean);
    dirty();
    final VirtualFile vf = myLocalFileSystem.refreshAndFindFileByIoFile(file);
    Assert.assertNotNull(vf);
    Assert.assertTrue(myChangeListManager.isIgnoredFile(vf));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) IgnoredFileBean(com.intellij.openapi.vcs.changes.IgnoredFileBean) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) Test(org.junit.Test)

Example 7 with IgnoredFileBean

use of com.intellij.openapi.vcs.changes.IgnoredFileBean in project intellij-community by JetBrains.

the class IgnoredFilesTest method testPatternIsIgnored.

@Test
public void testPatternIsIgnored() throws Exception {
    final String dirPath1 = myClientRoot.getPath() + "/a";
    final File dir = new File(myClientRoot, "a");
    dir.mkdir();
    final File innerDir = new File(dir, "innerDir");
    innerDir.mkdir();
    final File file1 = new File(innerDir, "file1");
    final File file2 = new File(innerDir, "file2");
    file1.createNewFile();
    file2.createNewFile();
    final VirtualFile innerVf = myLocalFileSystem.refreshAndFindFileByIoFile(innerDir);
    final VirtualFile vf1 = myLocalFileSystem.refreshAndFindFileByIoFile(file1);
    final VirtualFile vf2 = myLocalFileSystem.refreshAndFindFileByIoFile(file2);
    final IgnoredFileBean ignoredFileBean = IgnoredBeanFactory.withMask("file*");
    myChangeListManager.addFilesToIgnore(ignoredFileBean);
    dirty();
    Assert.assertNotNull(innerVf);
    Assert.assertFalse(myChangeListManager.isIgnoredFile(innerVf));
    Assert.assertEquals(FileStatus.UNKNOWN, myChangeListManager.getStatus(innerVf));
    Assert.assertTrue(myChangeListManager.isUnversioned(innerVf));
    assertFoundAndIgnored(vf1);
    assertFoundAndIgnored(vf2);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) IgnoredFileBean(com.intellij.openapi.vcs.changes.IgnoredFileBean) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) Test(org.junit.Test)

Example 8 with IgnoredFileBean

use of com.intellij.openapi.vcs.changes.IgnoredFileBean in project intellij-community by JetBrains.

the class IgnoredSettingsPanel method editItem.

private void editItem() {
    IgnoredFileBean bean = (IgnoredFileBean) myList.getSelectedValue();
    if (bean == null)
        return;
    IgnoreUnversionedDialog dlg = new IgnoreUnversionedDialog(myProject);
    dlg.setIgnoredFile(bean);
    if (dlg.showAndGet()) {
        IgnoredFileBean[] beans = dlg.getSelectedIgnoredFiles();
        assert beans.length == 1;
        int selectedIndex = myList.getSelectedIndex();
        myModel.setElementAt(beans[0], selectedIndex);
    }
}
Also used : IgnoredFileBean(com.intellij.openapi.vcs.changes.IgnoredFileBean)

Example 9 with IgnoredFileBean

use of com.intellij.openapi.vcs.changes.IgnoredFileBean in project intellij-community by JetBrains.

the class IgnoredFilesTest method testFileIsIgnored.

// they all blink now
@Test
public void testFileIsIgnored() throws Exception {
    final String filePath1 = myClientRoot.getPath() + "/a";
    final File file = new File(filePath1);
    file.createNewFile();
    final IgnoredFileBean ignoredFileBean = IgnoredBeanFactory.ignoreFile(filePath1, myProject);
    myChangeListManager.addFilesToIgnore(ignoredFileBean);
    dirty();
    final VirtualFile vf = myLocalFileSystem.refreshAndFindFileByIoFile(file);
    Assert.assertNotNull(vf);
    Assert.assertTrue(myChangeListManager.isIgnoredFile(vf));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) IgnoredFileBean(com.intellij.openapi.vcs.changes.IgnoredFileBean) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) Test(org.junit.Test)

Example 10 with IgnoredFileBean

use of com.intellij.openapi.vcs.changes.IgnoredFileBean in project intellij-community by JetBrains.

the class IgnoredFilesTest method testDirIsIgnored.

@Test
public void testDirIsIgnored() throws Exception {
    //final String dirPath1 = myClientRoot.getPath() + "/a";
    final File dir = new File(myClientRoot, "a");
    dir.mkdir();
    final File innerDir = new File(dir, "innerDir");
    innerDir.mkdir();
    final File file1 = new File(innerDir, "file1");
    final File file2 = new File(innerDir, "file2");
    file1.createNewFile();
    file2.createNewFile();
    final VirtualFile innerVf = myLocalFileSystem.refreshAndFindFileByIoFile(innerDir);
    final VirtualFile vf1 = myLocalFileSystem.refreshAndFindFileByIoFile(file1);
    final VirtualFile vf2 = myLocalFileSystem.refreshAndFindFileByIoFile(file2);
    final IgnoredFileBean ignoredFileBean = IgnoredBeanFactory.ignoreUnderDirectory(FileUtil.toSystemIndependentName(dir.getPath()), myProject);
    myChangeListManager.addFilesToIgnore(ignoredFileBean);
    dirty();
    assertFoundAndIgnored(innerVf);
    assertFoundAndIgnored(vf1);
    assertFoundAndIgnored(vf2);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) IgnoredFileBean(com.intellij.openapi.vcs.changes.IgnoredFileBean) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) Test(org.junit.Test)

Aggregations

IgnoredFileBean (com.intellij.openapi.vcs.changes.IgnoredFileBean)10 VirtualFile (com.intellij.openapi.vfs.VirtualFile)7 File (java.io.File)6 Test (org.junit.Test)6 ConfigurationException (com.intellij.openapi.options.ConfigurationException)1 IOException (java.io.IOException)1 MavenExplicitProfiles (org.jetbrains.idea.maven.model.MavenExplicitProfiles)1 MavenWorkspaceMap (org.jetbrains.idea.maven.model.MavenWorkspaceMap)1 MavenEmbedderWrapper (org.jetbrains.idea.maven.server.MavenEmbedderWrapper)1 MavenServerExecutionResult (org.jetbrains.idea.maven.server.MavenServerExecutionResult)1 MavenProcessCanceledException (org.jetbrains.idea.maven.utils.MavenProcessCanceledException)1