Index: core/src/org/tigris/subversion/subclipse/core/commands/RevertResourcesCommand.java =================================================================== --- core/src/org/tigris/subversion/subclipse/core/commands/RevertResourcesCommand.java (revision 2790) +++ core/src/org/tigris/subversion/subclipse/core/commands/RevertResourcesCommand.java (working copy) @@ -10,20 +10,24 @@ ******************************************************************************/ package org.tigris.subversion.subclipse.core.commands; +import java.io.File; import java.text.Collator; import java.util.Arrays; import java.util.Comparator; -import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceVisitor; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Status; import org.tigris.subversion.subclipse.core.SVNException; +import org.tigris.subversion.subclipse.core.SVNProviderPlugin; import org.tigris.subversion.subclipse.core.client.OperationManager; import org.tigris.subversion.subclipse.core.resources.LocalResourceStatus; import org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot; import org.tigris.subversion.svnclientadapter.ISVNClientAdapter; import org.tigris.subversion.svnclientadapter.SVNClientException; +import org.tigris.subversion.svnclientadapter.SVNNodeKind; /** * Revert changes made to the local verion of a file. This is equivalent to replace with base revision @@ -66,18 +70,33 @@ // sort first, so that all children of a folder directly follow it in the array Arrays.sort( resources, resourceComparator ); try { + final OperationManager operationManager = OperationManager.getInstance(); ISVNClientAdapter svnClient = root.getRepository().getSVNClient(); - OperationManager.getInstance().beginOperation(svnClient); + operationManager.beginOperation(svnClient); for (int i = 0; i < resources.length; i++) { LocalResourceStatus status = SVNWorkspaceRoot.getSVNResourceFor( resources[i] ).getStatus(); - // If a folder add is reverted, all the adds underneath it will be reverted too. + // If a folder add is reverted, all the adds underneath it will be reverted too. // Don't try to revert them. Because the resources are sorted by path we can just // keep going along the IResource array until we find one that doesn't have the // current as a base path. if (resources[i].getType() == IResource.FOLDER && status.isAdded()) { svnClient.revert(resources[i].getLocation().toFile(), true); monitor.worked(100); - SVNWorkspaceRoot.getSVNFolderFor( (IContainer)resources[i] ).refreshStatus(IResource.DEPTH_INFINITE); + + // Add the subdirectories to the list of resources which must + // be refreshed. + try { + resources[i].accept(new IResourceVisitor() { + public boolean visit(IResource aResource) { + if (aResource.getType() == IResource.FOLDER) + operationManager.onNotify(aResource.getLocation().toFile(), SVNNodeKind.UNKNOWN); + + return true; + } + }, IResource.DEPTH_INFINITE, false); + } catch (CoreException e) { + SVNProviderPlugin.log(Status.WARNING, "", e); + } // If folder path has no ending / we can have problem where dir foobar will look like subdir of foo String baseFullPath = resources[i].getFullPath().addTrailingSeparator().toString(); while (i < resources.length - 1 && resources[i+1].getFullPath().toString().startsWith( baseFullPath )) { @@ -94,7 +113,12 @@ } } else { - svnClient.revert(resources[i].getLocation().toFile(), false); + File path = resources[i].getLocation().toFile(); + svnClient.revert(path, false); + // If only properties were changed, svn 1.4.0 does not + // notify the change. As workaround, do it manually. + if (resources[i].getType() != IResource.FILE) + operationManager.onNotify(path, SVNNodeKind.UNKNOWN); monitor.worked(100); } } Index: core/src/org/tigris/subversion/subclipse/core/resourcesListeners/SyncFileChangeListener.java =================================================================== --- core/src/org/tigris/subversion/subclipse/core/resourcesListeners/SyncFileChangeListener.java (revision 2790) +++ core/src/org/tigris/subversion/subclipse/core/resourcesListeners/SyncFileChangeListener.java (working copy) @@ -241,7 +241,8 @@ protected IContainer handleChangedEntries(IResource resource, int kind) { IContainer changedContainer = resource.getParent(); - if(changedContainer.exists()) { + IContainer parent = changedContainer.getParent(); + if((parent != null) && parent.exists()) { return changedContainer; } else { return null; @@ -250,7 +251,8 @@ protected IContainer handleChangedDirProps(IResource resource, int kind) { IContainer changedContainer = resource.getParent(); - if(changedContainer.exists()) { + IContainer parent = changedContainer.getParent(); + if((parent != null) && parent.exists()) { return changedContainer; } else { return null; @@ -259,7 +261,8 @@ protected IContainer handleChangedPropFile(IResource resource, int kind) { IContainer changedContainer = resource.getParent().getParent(); - if(changedContainer.exists()) { + IContainer parent = changedContainer.getParent(); + if((parent != null) && parent.exists()) { return changedContainer; } else { return null; Index: core/src/org/tigris/subversion/subclipse/core/client/OperationManager.java =================================================================== --- core/src/org/tigris/subversion/subclipse/core/client/OperationManager.java (revision 2790) +++ core/src/org/tigris/subversion/subclipse/core/client/OperationManager.java (working copy) @@ -139,11 +139,19 @@ IPath pathEntries = pathEclipse.removeLastSegments(1).append( SVNProviderPlugin.getPlugin().getAdminDirectoryName()); IResource entries = workspaceRoot.getContainerForLocation(pathEntries); - if (entries == null) //probably the pathEclipse was project itself + if (entries != null) //probably the pathEclipse was project itself { - entries = workspaceRoot.getProject(pathEclipse.lastSegment()).getFolder(new Path(SVNProviderPlugin.getPlugin().getAdminDirectoryName())); + changedResources.add(entries); } - changedResources.add(entries); + + if (path.isDirectory()) { + IResource resource = workspaceRoot.getContainerForLocation(pathEclipse); + if (resource != null && resource.getType() != IResource.ROOT) { + IResource svnDir = ((IContainer) resource).getFolder(new Path( + SVNProviderPlugin.getPlugin().getAdminDirectoryName())); + changedResources.add(svnDir); + } + } } else {