Commit 06533c1b authored by agurov's avatar agurov

No way to specify correctly a name for the resources traversal operation (bug 345855)

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

git-svn-id: https://dev.eclipse.org/svnroot/technology/org.eclipse.subversive/trunk@20982 ee007c2a-0a25-0410-9ab9-bf268980928c
parent 05ec79c6
......@@ -12,6 +12,7 @@
package org.eclipse.team.svn.core.operation.local;
import org.eclipse.core.resources.IResource;
import org.eclipse.team.svn.core.SVNMessages;
import org.eclipse.team.svn.core.operation.local.change.visitors.RemoveNonVersionedVisitor;
import org.eclipse.team.svn.core.resource.IResourceProvider;
......@@ -23,11 +24,11 @@ import org.eclipse.team.svn.core.resource.IResourceProvider;
*/
public class RemoveNonVersionedResourcesOperation extends ResourcesTraversalOperation {
public RemoveNonVersionedResourcesOperation(IResource[] resources, boolean addedAlso) {
super(resources, new RemoveNonVersionedVisitor(addedAlso), IResource.DEPTH_INFINITE);
super("Operation_RemoveNonSVN", SVNMessages.class, resources, new RemoveNonVersionedVisitor(addedAlso), IResource.DEPTH_INFINITE);
}
public RemoveNonVersionedResourcesOperation(IResourceProvider provider, boolean addedAlso) {
super(provider, new RemoveNonVersionedVisitor(addedAlso), IResource.DEPTH_INFINITE);
super("Operation_RemoveNonSVN", SVNMessages.class, provider, new RemoveNonVersionedVisitor(addedAlso), IResource.DEPTH_INFINITE);
}
}
......@@ -13,7 +13,7 @@ package org.eclipse.team.svn.core.operation.local;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.svn.core.SVNMessages;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.svn.core.operation.IActionOperation;
import org.eclipse.team.svn.core.operation.IUnprotectedOperation;
import org.eclipse.team.svn.core.operation.local.change.IActionOperationProcessor;
......@@ -33,15 +33,14 @@ public class ResourcesTraversalOperation extends AbstractWorkingCopyOperation im
protected IResourceChangeVisitor visitor;
protected int depth;
//FIXME externalize operation name, to do so first NLS support should be reworked: SVNMessages.class should be passed transparently.
public ResourcesTraversalOperation(IResource[] resources, IResourceChangeVisitor visitor, int depth) {
super("Operation_RemoveNonSVN", SVNMessages.class, resources); //$NON-NLS-1$
public ResourcesTraversalOperation(String operationName, Class<? extends NLS> messagesClass, IResource[] resources, IResourceChangeVisitor visitor, int depth) {
super(operationName, messagesClass, resources); //$NON-NLS-1$
this.visitor = visitor;
this.depth = depth;
}
public ResourcesTraversalOperation(IResourceProvider provider, IResourceChangeVisitor visitor, int depth) {
super("Operation_RemoveNonSVN", SVNMessages.class, provider); //$NON-NLS-1$
public ResourcesTraversalOperation(String operationName, Class<? extends NLS> messagesClass, IResourceProvider provider, IResourceChangeVisitor visitor, int depth) {
super(operationName, messagesClass, provider); //$NON-NLS-1$
this.visitor = visitor;
this.depth = depth;
}
......
......@@ -20,6 +20,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.svn.core.IStateFilter;
import org.eclipse.team.svn.core.SVNMessages;
import org.eclipse.team.svn.core.operation.CompositeOperation;
import org.eclipse.team.svn.core.operation.IActionOperation;
import org.eclipse.team.svn.core.operation.IUnprotectedOperation;
......@@ -79,7 +80,7 @@ public class ReplaceWithLatestRevisionAction extends AbstractNonRecursiveTeamAct
IActionOperation revertOp = new RevertOperation(resources, true);
op.add(revertOp);
IActionOperation removeOp = new ResourcesTraversalOperation(resources, new RemoveNonVersionedVisitor(true), IResource.DEPTH_INFINITE);
IActionOperation removeOp = new ResourcesTraversalOperation("Operation_RemoveNonSVN", SVNMessages.class, resources, new RemoveNonVersionedVisitor(true), IResource.DEPTH_INFINITE);
op.add(removeOp, new IActionOperation[] {revertOp});
boolean ignoreExternals = SVNTeamPreferences.getBehaviourBoolean(SVNTeamUIPlugin.instance().getPreferenceStore(), SVNTeamPreferences.BEHAVIOUR_IGNORE_EXTERNALS_NAME);
op.add(new UpdateOperation(resources, ignoreExternals), new IActionOperation[] {revertOp, removeOp});
......
......@@ -15,6 +15,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.svn.core.IStateFilter;
import org.eclipse.team.svn.core.SVNMessages;
import org.eclipse.team.svn.core.operation.CompositeOperation;
import org.eclipse.team.svn.core.operation.IActionOperation;
import org.eclipse.team.svn.core.operation.local.RefreshResourcesOperation;
......@@ -74,7 +75,7 @@ public class RevertAction extends AbstractRecursiveTeamAction {
op.add(mainOp);
if (panel.getRemoveNonVersioned()) {
op.add(new RefreshResourcesOperation(new ResourcesParentsProvider(selectedResources), IResource.DEPTH_INFINITE, RefreshResourcesOperation.REFRESH_CACHE), new IActionOperation[] {mainOp});
op.add(new ResourcesTraversalOperation(changedResources, new RemoveNonVersionedVisitor(true), IResource.DEPTH_INFINITE), new IActionOperation[] {mainOp});
op.add(new ResourcesTraversalOperation("Operation_RemoveNonSVN", SVNMessages.class, changedResources, new RemoveNonVersionedVisitor(true), IResource.DEPTH_INFINITE), new IActionOperation[] {mainOp});
}
op.add(restoreOp);
op.add(new RefreshResourcesOperation(new ResourcesParentsProvider(selectedResources), IResource.DEPTH_INFINITE, RefreshResourcesOperation.REFRESH_ALL));
......
......@@ -158,7 +158,7 @@ public class UpdateSubscriberContext extends SubscriberMergeContext {
* Probably there are case where we need to call RemoveNonVersionedResourcesOperation once again after revert operation,
* but I didn't find them
*/
IActionOperation removeNonVersionedResourcesOp = new ResourcesTraversalOperation(resources[0], new RemoveNonVersionedVisitor(true), IResource.DEPTH_INFINITE);
IActionOperation removeNonVersionedResourcesOp = new ResourcesTraversalOperation("Operation_RemoveNonSVN", SVNMessages.class, resources[0], new RemoveNonVersionedVisitor(true), IResource.DEPTH_INFINITE);
op.add(removeNonVersionedResourcesOp);
RevertOperation revertOp = new RevertOperation(FileUtility.getResourcesRecursive(resources[0], IStateFilter.SF_REVERTABLE, IResource.DEPTH_ZERO), true);
op.add(revertOp);
......
......@@ -22,6 +22,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.svn.core.IStateFilter;
import org.eclipse.team.svn.core.SVNMessages;
import org.eclipse.team.svn.core.connector.SVNRevision;
import org.eclipse.team.svn.core.operation.CompositeOperation;
import org.eclipse.team.svn.core.operation.IActionOperation;
......@@ -111,7 +112,7 @@ public class OverrideAndUpdateAction extends AbstractSynchronizeModelAction {
* Probably there are case where we need to call RemoveNonVersionedResourcesOperation once again after revert operation,
* but I didn't find them
*/
IActionOperation removeNonVersionedResourcesOp = new ResourcesTraversalOperation(resources[0], new RemoveNonVersionedVisitor(true), IResource.DEPTH_INFINITE);
IActionOperation removeNonVersionedResourcesOp = new ResourcesTraversalOperation("Operation_RemoveNonSVN", SVNMessages.class, resources[0], new RemoveNonVersionedVisitor(true), IResource.DEPTH_INFINITE);
op.add(removeNonVersionedResourcesOp);
RevertOperation revertOp = new RevertOperation(FileUtility.getResourcesRecursive(resources[0], IStateFilter.SF_REVERTABLE, IResource.DEPTH_ZERO), true);
op.add(revertOp);
......
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