Commit 5ab18280 authored by agurov's avatar agurov

Ignored files shown as outgoing additions (bug 392750)

https://bugs.eclipse.org/bugs/show_bug.cgi?id=392750

git-svn-id: https://dev.eclipse.org/svnroot/technology/org.eclipse.subversive/trunk@21554 ee007c2a-0a25-0410-9ab9-bf268980928c
parent 1a82c82a
......@@ -64,7 +64,7 @@ public class AddToSVNWithPropertiesOperation extends AddToSVNOperation {
FileUtility.visitNodes(current, new IResourceVisitor() {
public boolean visit(IResource resource) throws CoreException {
if (monitor.isCanceled() || FileUtility.isIgnored(resource) || !resource.isAccessible()) {
if (monitor.isCanceled() || FileUtility.isNotSupervised(resource)) {
return false;
}
......
......@@ -137,7 +137,7 @@ public class CreatePatchOperation extends AbstractActionOperation {
else if (this.recurse) {
FileUtility.visitNodes(resources[i], new IResourceVisitor() {
public boolean visit(IResource resource) throws CoreException {
if (FileUtility.isIgnored(resource)) {
if (monitor.isCanceled() || FileUtility.isNotSupervised(resource)) {
return false;
}
if (resource instanceof IFile) {
......
......@@ -80,7 +80,7 @@ public class GetMultiPropertiesOperation extends AbstractActionOperation impleme
public void run(final IProgressMonitor monitor) throws Exception {
FileUtility.visitNodes(current, new IResourceVisitor() {
public boolean visit(IResource resource) throws CoreException {
if (monitor.isCanceled() || FileUtility.isIgnored(resource)) {
if (monitor.isCanceled() || FileUtility.isNotSupervised(resource)) {
return false;
}
ILocalResource local = SVNRemoteStorage.instance().asLocalResourceAccessible(resource);
......
......@@ -67,7 +67,7 @@ public class SetMultiPropertiesOperation extends AbstractWorkingCopyOperation {
public void run(final IProgressMonitor monitor) throws Exception {
FileUtility.visitNodes(current, new IResourceVisitor() {
public boolean visit(IResource resource) throws CoreException {
if (monitor.isCanceled() || FileUtility.isIgnored(resource)) {
if (monitor.isCanceled() || FileUtility.isNotSupervised(resource)) {
return false;
}
ILocalResource local = SVNRemoteStorage.instance().asLocalResourceAccessible(resource);
......
......@@ -85,7 +85,7 @@ public class ResourceStatesChangedEvent {
for (int i = 0; i < resources.length; i++) {
FileUtility.visitNodes(resources[i], new IResourceVisitor() {
public boolean visit(IResource resource) throws CoreException {
if (FileUtility.isSVNInternals(resource) || FileUtility.isIgnored(resource)) {
if (FileUtility.isNotSupervised(resource)) {
return false;
}
fullList.add(resource);
......
......@@ -114,7 +114,7 @@ public abstract class AbstractSVNSubscriber extends Subscriber implements IResou
}
public boolean isSupervised(IResource resource) {
return FileUtility.isConnected(resource) && !FileUtility.isSVNInternals(resource) && !FileUtility.isIgnored(resource);
return FileUtility.isConnected(resource) && !FileUtility.isNotSupervised(resource);
}
public IResource []members(IResource resource) throws TeamException {
......
......@@ -255,10 +255,12 @@ public final class FileUtility {
}
/*
* If the resource is a derived, team private or linked resource, it is ignored
* If the resource is inaccessible, the workspace root, a team private or a linked one, it should not be managed by SVN plug-in
*/
public static boolean isIgnored(IResource resource) {
return resource.isDerived() || resource.isTeamPrivateMember() || FileUtility.isLinked(resource);
public static boolean isNotSupervised(IResource resource) {
return
resource instanceof IWorkspaceRoot || !resource.isAccessible() ||
resource.isTeamPrivateMember() || FileUtility.isLinked(resource);
}
public static String []asPathArray(IResource []resources) {
......@@ -408,7 +410,7 @@ public final class FileUtility {
// first check all resources that are already accessible (performance optimizations)
for (int i = 0; i < roots.length; i++) {
//don't check ignored resources
if (FileUtility.isIgnored(roots[i])) {//FileUtility.isSVNInternals(roots[i])
if (FileUtility.isNotSupervised(roots[i])) {//FileUtility.isSVNInternals(roots[i])
continue;
}
......@@ -656,7 +658,7 @@ public final class FileUtility {
toRemove.add(resource);
return false;
}
return !FileUtility.isIgnored(resource);
return !FileUtility.isNotSupervised(resource);
}
},
IResource.DEPTH_INFINITE,
......@@ -863,7 +865,7 @@ public final class FileUtility {
int nextDepth = depth == IResource.DEPTH_ONE ? IResource.DEPTH_ZERO : IResource.DEPTH_INFINITE;
for (int i = 0; i < roots.length && (monitor == null || !monitor.isCanceled()); i++) {
//don't process ignored resources
if (FileUtility.isIgnored(roots[i])) {//FileUtility.isSVNInternals(roots[i])
if (FileUtility.isNotSupervised(roots[i])) {//FileUtility.isSVNInternals(roots[i])
continue;
}
......
......@@ -45,7 +45,6 @@ import org.eclipse.core.net.proxy.IProxyData;
import org.eclipse.core.net.proxy.IProxyService;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
......@@ -1001,21 +1000,20 @@ public final class SVNUtility {
}
public static boolean isIgnored(IResource resource) {
// Ignore WorkspaceRoot, derived and team-private resources and resources from TeamHints
if (resource instanceof IWorkspaceRoot || resource.isDerived() ||
FileUtility.isSVNInternals(resource) || Team.isIgnoredHint(resource) || SVNUtility.isMergeParts(resource)) {
if (FileUtility.isNotSupervised(resource) ||
(resource.isDerived() /*&& !CoreExtensionsManager.instance().getOptionProvider().is(IOptionProvider.COMMIT_DERIVED_ENABLED)*/) ||
Team.isIgnoredHint(resource) || SVNUtility.isMergeParts(resource)) {
return true;
}
try {
IIgnoreRecommendations []ignores = CoreExtensionsManager.instance().getIgnoreRecommendations();
for (int i = 0; i < ignores.length; i++) {
if (ignores[i].isAcceptableNature(resource) && ignores[i].isIgnoreRecommended(resource)) {
for (IIgnoreRecommendations ignore : CoreExtensionsManager.instance().getIgnoreRecommendations()) {
if (ignore.isAcceptableNature(resource) && ignore.isIgnoreRecommended(resource)) {
return true;
}
}
}
catch (Exception ex) {
// cannot be correctly processed in the caller context
catch (CoreException ex) {
throw new RuntimeException(ex);
}
return false;
}
......
......@@ -56,7 +56,7 @@ public abstract class FileUtilityTest extends AbstractOperationTestCase {
cntr[0] = 0;
FileUtility.visitNodes(prj1, new IResourceVisitor() {
public boolean visit(IResource resource) throws CoreException {
if (FileUtility.isSVNInternals(resource) || FileUtility.isIgnored(resource)) {
if (FileUtility.isNotSupervised(resource)) {
return false;
}
cntr[0]++;
......@@ -65,7 +65,7 @@ public abstract class FileUtilityTest extends AbstractOperationTestCase {
}, IResource.DEPTH_INFINITE);
FileUtility.visitNodes(prj2, new IResourceVisitor() {
public boolean visit(IResource resource) throws CoreException {
if (FileUtility.isSVNInternals(resource) || FileUtility.isIgnored(resource)) {
if (FileUtility.isNotSupervised(resource)) {
return false;
}
cntr[0]++;
......
......@@ -185,7 +185,7 @@ public abstract class AbstractSVNTeamAction extends TeamAction {
List<IResource> res = new ArrayList<IResource>();
IResource[] resources = super.getSelectedResources();
for (IResource resource : resources) {
if (!FileUtility.isIgnored(resource)) {
if (!FileUtility.isNotSupervised(resource)) {
res.add(resource);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment