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));
}
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);
}
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);
}
}
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));
}
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);
}
Aggregations