Commit 3b2ca885 authored by agurov's avatar agurov

Symbolic links and external resources interfere with each other in UI (bug 471204)

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

git-svn-id: https://dev.eclipse.org/svnroot/technology/org.eclipse.subversive/trunk@21487 ee007c2a-0a25-0410-9ab9-bf268980928c
parent 02d1b4cb
......@@ -280,7 +280,8 @@ public interface IStateFilter {
public static final IStateFilter SF_UNVERSIONED_EXTERNAL = new AbstractStateFilter() {
protected boolean acceptImpl(ILocalResource local, IResource resource, String state, int mask) {
return state == IStateFilter.ST_IGNORED && (mask & ILocalResource.IS_UNVERSIONED_EXTERNAL) != 0;
//return state == IStateFilter.ST_IGNORED && (mask & ILocalResource.IS_UNVERSIONED_EXTERNAL) != 0;
return state == IStateFilter.ST_IGNORED && (mask & ILocalResource.IS_SVN_EXTERNALS) != 0;
}
protected boolean allowsRecursionImpl(ILocalResource local, IResource resource, String state, int mask) {
return IStateFilter.SF_VERSIONED.accept(resource, state, mask);
......@@ -359,6 +360,18 @@ public interface IStateFilter {
}
};
public static final IStateFilter SF_IGNORED_NOT_FORBIDDEN = new AbstractStateFilter() {
protected boolean acceptImpl(ILocalResource local, IResource resource, String state, int mask) {
return IStateFilter.SF_IGNORED.accept(resource, state, mask) && (mask & ILocalResource.IS_FORBIDDEN) == 0;
}
protected boolean allowsRecursionImpl(ILocalResource local, IResource resource, String state, int mask) {
return true;
}
};
/**
* @deprecated due to mixed semantics
*/
public static final IStateFilter SF_IGNORED_BUT_NOT_EXTERNAL = new AbstractStateFilter() {
protected boolean acceptImpl(ILocalResource local, IResource resource, String state, int mask) {
return IStateFilter.SF_IGNORED.accept(resource, state, mask) && (mask & ILocalResource.IS_UNVERSIONED_EXTERNAL) == 0;
......@@ -409,10 +422,8 @@ public interface IStateFilter {
return !IStateFilter.SF_TREE_CONFLICTING_REPOSITORY_EXIST.accept(local);
}
return
state == IStateFilter.ST_PREREPLACED || state == IStateFilter.ST_NEW ||
IStateFilter.SF_IGNORED_BUT_NOT_EXTERNAL.accept(resource, state, mask) ||
state == IStateFilter.ST_NOTEXISTS ||
state == IStateFilter.ST_ADDED;
state == IStateFilter.ST_PREREPLACED || state == IStateFilter.ST_NEW || state == IStateFilter.ST_IGNORED ||
state == IStateFilter.ST_NOTEXISTS || state == IStateFilter.ST_ADDED;
}
protected boolean allowsRecursionImpl(ILocalResource local, IResource resource, String state, int mask) {
return true;
......@@ -441,7 +452,9 @@ public interface IStateFilter {
return (state == IStateFilter.ST_PREREPLACED || state == IStateFilter.ST_NEW) && !IStateFilter.SF_IGNORED.accept(resource, state, mask);
}
protected boolean allowsRecursionImpl(ILocalResource local, IResource resource, String state, int mask) {
return !IStateFilter.SF_IGNORED_BUT_NOT_EXTERNAL.accept(resource, state, mask) && state != IStateFilter.ST_OBSTRUCTED && state != IStateFilter.ST_LINKED;
return
(!IStateFilter.SF_IGNORED.accept(resource, state, mask) || (mask & ILocalResource.IS_SVN_EXTERNALS) != 0) &&
state != IStateFilter.ST_OBSTRUCTED && state != IStateFilter.ST_LINKED;
}
};
......@@ -572,7 +585,9 @@ public interface IStateFilter {
state != IStateFilter.ST_OBSTRUCTED && state != IStateFilter.ST_LINKED;
}
protected boolean allowsRecursionImpl(ILocalResource local, IResource resource, String state, int mask) {
return !IStateFilter.SF_IGNORED_BUT_NOT_EXTERNAL.accept(resource, state, mask) && state != IStateFilter.ST_OBSTRUCTED && state != IStateFilter.ST_LINKED;
return
(!IStateFilter.SF_IGNORED.accept(resource, state, mask) || (mask & ILocalResource.IS_SVN_EXTERNALS) != 0) &&
state != IStateFilter.ST_OBSTRUCTED && state != IStateFilter.ST_LINKED;
}
};
......@@ -630,7 +645,9 @@ public interface IStateFilter {
!IStateFilter.SF_NOTMODIFIED.accept(resource, state, mask);
}
protected boolean allowsRecursionImpl(ILocalResource local, IResource resource, String state, int mask) {
return !IStateFilter.SF_IGNORED_BUT_NOT_EXTERNAL.accept(resource, state, mask) && state != IStateFilter.ST_OBSTRUCTED && state != IStateFilter.ST_LINKED;
return
(!IStateFilter.SF_IGNORED.accept(resource, state, mask) || (mask & ILocalResource.IS_SVN_EXTERNALS) != 0) &&
state != IStateFilter.ST_OBSTRUCTED && state != IStateFilter.ST_LINKED;
}
};
......
......@@ -35,7 +35,12 @@ public interface ILocalResource {
public static final int IS_SWITCHED = 0x08;
public static final int IS_LOCKED = 0x10;
public static final int TREE_CONFLICT_UNKNOWN_NODE_KIND = 0x20;
/**
* @deprecated due to mixed semantics it is replaced with IS_FORBIDDEN which is required to prevent SVN actions with resources,
* while unversioned resources, produced by svn:externals, will be marked as ST_IGNORED + IS_SVN_EXTERNALS
*/
public static final int IS_UNVERSIONED_EXTERNAL = 0x40;
public static final int IS_FORBIDDEN = 0x40;
public static final int IS_SVN_EXTERNALS = 0x80;
public static final int IS_SYMLINK = 0x100;
......
......@@ -56,7 +56,7 @@ public class QueryResourceAddition {
* @return recursive, non-recursive additions and root nodes
*/
public IResource [][]queryAdditionsSeparated() {
HashSet<IResource> nonRecursive = new HashSet<IResource>(Arrays.asList(this.selector.getSelectedResources(IStateFilter.SF_IGNORED)));
HashSet<IResource> nonRecursive = new HashSet<IResource>(Arrays.asList(this.selector.getSelectedResources(IStateFilter.SF_IGNORED_NOT_FORBIDDEN)));
HashSet<IResource> recursive = new HashSet<IResource>(Arrays.asList(this.selector.getSelectedResourcesRecursive(IStateFilter.SF_NEW)));
HashSet<IResource> resources = new HashSet<IResource>();
......@@ -97,7 +97,7 @@ public class QueryResourceAddition {
public static IResource []getSelectedForAddition(IResourceSelector selector) {
Set<IResource> resources = new HashSet<IResource>();
// non-recursive part (ignored)
resources.addAll(Arrays.asList(selector.getSelectedResources(IStateFilter.SF_IGNORED)));
resources.addAll(Arrays.asList(selector.getSelectedResources(IStateFilter.SF_IGNORED_NOT_FORBIDDEN)));
// all new resources that can be fetched recursively
resources.addAll(Arrays.asList(selector.getSelectedResourcesRecursive(IStateFilter.SF_NEW)));
return resources.toArray(new IResource[resources.size()]);
......
......@@ -49,7 +49,7 @@ public class AddToSVNAction extends AbstractRecursiveTeamAction {
public boolean isEnabled() {
return
this.checkForResourcesPresence(IStateFilter.SF_IGNORED) ||
this.checkForResourcesPresence(IStateFilter.SF_IGNORED_NOT_FORBIDDEN) ||
this.checkForResourcesPresenceRecursive(IStateFilter.SF_NEW);
}
......
......@@ -72,7 +72,7 @@ public class CommitActionUtility {
this.allResourcesSet = new HashSet<IResource>();
this.allResourcesSet.addAll(Arrays.asList(this.selector.getSelectedResourcesRecursive(new IStateFilter.OrStateFilter(new IStateFilter[] {IStateFilter.SF_COMMITABLE, IStateFilter.SF_CONFLICTING, IStateFilter.SF_TREE_CONFLICTING, IStateFilter.SF_NEW}))));
this.newNonRecursive = new HashSet<IResource>(Arrays.asList(this.selector.getSelectedResources(IStateFilter.SF_IGNORED)));
this.newNonRecursive = new HashSet<IResource>(Arrays.asList(this.selector.getSelectedResources(IStateFilter.SF_IGNORED_NOT_FORBIDDEN)));
this.newRecursive = new HashSet<IResource>(Arrays.asList(FileUtility.getResourcesRecursive((IResource [])this.allResourcesSet.toArray(new IResource[this.allResourcesSet.size()]), IStateFilter.SF_NEW, IResource.DEPTH_ZERO)));
HashSet<IResource> fullSet = new HashSet<IResource>(this.newNonRecursive);
......
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