mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-124017 (“core” is ignored automatically in IntelliJ VCS)
This commit is contained in:
+1
-1
@@ -337,7 +337,7 @@ public class CvsEntriesManager extends VirtualFileAdapter {
|
||||
return false;
|
||||
}
|
||||
if (CvsUtil.fileIsUnderCvs(file)) return false;
|
||||
return getFilter(parent).shouldBeIgnored(file.getName());
|
||||
return getFilter(parent).shouldBeIgnored(file);
|
||||
}
|
||||
|
||||
private void ensureFilesCached() {
|
||||
|
||||
+1
-1
@@ -33,6 +33,6 @@ public class IgnoreFileFilterBasedOnCvsEntriesManager implements IIgnoreFileFilt
|
||||
VirtualFile virtualFile = CvsVfsUtil.findFileByIoFile(file);
|
||||
if (virtualFile == null) return false;
|
||||
IgnoredFilesInfo filter = CvsEntriesManager.getInstance().getFilter(virtualFile.getParent());
|
||||
return filter.shouldBeIgnored(file.getName());
|
||||
return filter.shouldBeIgnored(virtualFile);
|
||||
}
|
||||
}
|
||||
|
||||
+14
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.intellij.cvsSupport2.cvsIgnore;
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
|
||||
/**
|
||||
* author: lesya
|
||||
*/
|
||||
@@ -24,13 +26,24 @@ public interface IgnoredFilesInfo {
|
||||
public boolean shouldBeIgnored(String fileName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldBeIgnored(VirtualFile file) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
IgnoredFilesInfo IGNORE_ALL = new IgnoredFilesInfo() {
|
||||
public boolean shouldBeIgnored(String fileName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldBeIgnored(VirtualFile file) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
boolean shouldBeIgnored(String fileName);
|
||||
|
||||
boolean shouldBeIgnored(VirtualFile file);
|
||||
}
|
||||
|
||||
+14
@@ -17,6 +17,7 @@ package com.intellij.cvsSupport2.cvsIgnore;
|
||||
|
||||
import com.intellij.cvsSupport2.application.CvsEntriesManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.netbeans.lib.cvsclient.util.SimpleStringPattern;
|
||||
|
||||
import java.io.*;
|
||||
@@ -72,6 +73,13 @@ public class IgnoredFilesInfoImpl implements IgnoredFilesInfo {
|
||||
if (checkPatterns(PREDEFINED_PATTERNS, fileName)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean shouldBeIgnored(VirtualFile file) {
|
||||
final String fileName = file.getName();
|
||||
if (checkPatterns(CvsEntriesManager.getInstance().getUserDirIgnores().getPatterns(), fileName)) return true;
|
||||
if (file.isDirectory()) return false;
|
||||
return checkPatterns(PREDEFINED_PATTERNS, fileName);
|
||||
}
|
||||
};
|
||||
|
||||
private List<SimpleStringPattern> myPatterns = null;
|
||||
@@ -125,6 +133,12 @@ public class IgnoredFilesInfoImpl implements IgnoredFilesInfo {
|
||||
return checkPatterns(myPatterns, fileName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldBeIgnored(VirtualFile file) {
|
||||
if (EMPTY_FILTER.shouldBeIgnored(file)) return true;
|
||||
return checkPatterns(myPatterns, file.getName());
|
||||
}
|
||||
|
||||
protected static boolean checkPatterns(List<SimpleStringPattern> patterns, String fileName) {
|
||||
for (int i = 0, patternsSize = patterns.size(); i < patternsSize; i++) {
|
||||
SimpleStringPattern simpleStringPattern = patterns.get(i);
|
||||
|
||||
+2
-2
@@ -278,7 +278,7 @@ public class CvsChangeProvider implements ChangeProvider {
|
||||
}
|
||||
final CvsInfo info = myEntriesManager.getCvsInfoFor(dir);
|
||||
if (info.getRepository() == null) {
|
||||
if (info.getIgnoreFilter().shouldBeIgnored(dir.getName())) {
|
||||
if (info.getIgnoreFilter().shouldBeIgnored(dir)) {
|
||||
builder.processIgnoredFile(dir);
|
||||
}
|
||||
else {
|
||||
@@ -492,7 +492,7 @@ public class CvsChangeProvider implements ChangeProvider {
|
||||
}
|
||||
else {
|
||||
if (isInContent(unknown)) {
|
||||
final boolean isIgnored = result.getCvsInfo().getIgnoreFilter().shouldBeIgnored(unknown.getName());
|
||||
final boolean isIgnored = result.getCvsInfo().getIgnoreFilter().shouldBeIgnored(unknown);
|
||||
if (isIgnored) {
|
||||
result.addIgnoredFile(unknown);
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -237,8 +237,8 @@ public class ImportTree extends NodeRenderer {
|
||||
if (file.isDirectory() && file.getName().equals(CvsUtil.CVS)) return true;
|
||||
|
||||
if (FileTypeManager.getInstance().isFileIgnored(abstractFileObject.getName())) return true;
|
||||
final VirtualFile vFile = LocalFileSystem.getInstance().findFileByIoFile(file);
|
||||
if (myProject != null && !includedFiles.contains(file)) {
|
||||
final VirtualFile vFile = LocalFileSystem.getInstance().findFileByIoFile(file);
|
||||
if (vFile != null && isIgnoredByVcs(vFile)) {
|
||||
return true;
|
||||
}
|
||||
@@ -250,7 +250,7 @@ public class ImportTree extends NodeRenderer {
|
||||
if (!myParentToIgnoresMap.containsKey(parentFile)) {
|
||||
myParentToIgnoresMap.put(parentFile, IgnoredFilesInfoImpl.createForFile(new File(parentFile, CvsUtil.CVS_IGNORE_FILE)));
|
||||
}
|
||||
return myParentToIgnoresMap.get(parentFile).shouldBeIgnored(file.getName());
|
||||
return myParentToIgnoresMap.get(parentFile).shouldBeIgnored(vFile);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user