if (revert) { run(new WorkspaceModifyOperation() { public void execute(IProgressMonitor monitor) throws InvocationTargetException { try { for (int i = 0; i < resourcesToRevert.length; i++) {  ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resourcesToRevert[i]); if (svnResource instanceof LocalResource) ((LocalResource)svnResource).revert(false); else svnResource.revert();   if (resourcesToRevert[i].getType() == IResource.FILE) { resourcesToRevert[i].getParent().refreshLocal(IResource.DEPTH_ONE, monitor); } else { resourcesToRevert[i].refreshLocal(IResource.DEPTH_INFINITE, monitor); } } } catch (TeamException e) { throw new InvocationTargetException(e); } catch (CoreException e) { throw new InvocationTargetException(e); }
getShell().getDisplay().syncExec(new Runnable() { public void run() { if (resources == null || resources.length == 0) { revert = false; return;
    protected void run(SVNTeamProvider provider, SyncInfoSet set, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {	    if (revert) {		    run(new WorkspaceModifyOperation() {				public void execute(IProgressMonitor monitor) throws InvocationTargetException {					try {						for (int i = 0; i < resourcesToRevert.length; i++) {														ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resourcesToRevert[i]);							if (svnResource instanceof LocalResource) ((LocalResource)svnResource).revert(false);							else svnResource.revert();														// Revert on a file can also be used to resolve a merge conflict							if (resourcesToRevert[i].getType() == IResource.FILE) {								resourcesToRevert[i].getParent().refreshLocal(IResource.DEPTH_ONE, monitor);							} else {								resourcesToRevert[i].refreshLocal(IResource.DEPTH_INFINITE, monitor);							}						}					} catch (TeamException e) {						throw new InvocationTargetException(e);					} catch (CoreException e) {						throw new InvocationTargetException(e);					}				}			}, false /* cancelable */, PROGRESS_BUSYCURSOR);	    }       }