ISVNStatus[] statuses = cmd.getStatuses(); Arrays.sort(statuses, new Comparator() { public int compare(Object o1, Object o2) { return ((ISVNStatus) o1).getPath().compareTo(((ISVNStatus) o2).getPath()); } });
InformedStatus[] statuses = cmd.getInformedStatuses();
    private IResource[] findChanges(IResource resource, int depth) throws TeamException {        System.out.println("SVNWorkspaceSubscriber.refresh()"+resource+" "+depth);		        IWorkspace workspace = ResourcesPlugin.getWorkspace();        IWorkspaceRoot workspaceRoot = workspace.getRoot();                remoteSyncStateStore.flushBytes(resource, depth);        ISVNClientAdapter client = SVNProviderPlugin.getPlugin().createSVNClient();        ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor( resource );        boolean descend = (depth == IResource.DEPTH_INFINITE)? true : false;        try {            List allChanges = new ArrayList();            Set containerSet = new HashSet();            StatusCommand cmd = new StatusCommand(svnResource.getFile(), descend, false, true );            cmd.execute( client );            ISVNStatus[] statuses = cmd.getStatuses();            Arrays.sort(statuses, new Comparator() {				public int compare(Object o1, Object o2) {					return ((ISVNStatus) o1).getPath().compareTo(((ISVNStatus) o2).getPath());				}            	            });            //Collect changed resources (in reverse order so dirs are properly identified            for (int i = statuses.length - 1; i >= 0; i--) {                ISVNStatus status = statuses[i];                IPath path = new Path(status.getPath());                IResource changedResource = null;                if ( SVNNodeKind.DIR == status.getNodeKind() ) {                    changedResource = workspaceRoot.getContainerForLocation(path);                }                else if ( SVNNodeKind.FILE == status.getNodeKind() ) {                    changedResource = workspaceRoot.getFileForLocation(path);                }                else if ( SVNNodeKind.UNKNOWN  == status.getNodeKind() ) {                    changedResource = workspaceRoot.getContainerForLocation(path);                                        if( changedResource.exists() )                        containerSet.add( changedResource );                    else  if( !containerSet.contains( changedResource ) )                        changedResource = workspaceRoot.getFileForLocation(path);                }                if( changedResource != null ) {                    containerSet.add(changedResource.getParent());                                        allChanges.add(new StatusResourcePair(changedResource, status));                }            }            IResource[] result = new IResource[allChanges.size()];            int i= 0;            //In reverse-reverse order so dir syncInfos are created sooner then files ...            for (ListIterator iter = allChanges.listIterator(allChanges.size()); iter.hasPrevious(); i++) {            	StatusResourcePair changedResourcePair = (StatusResourcePair) iter.previous();            	result[i] = changedResourcePair.getResource();				                if (isSupervised(changedResourcePair.getResource()))                {                    StatusInfo remoteInfo = new StatusInfo(cmd.getRevision(), changedResourcePair.getStatus().getRepositoryTextStatus(), changedResourcePair.getStatus().getRepositoryPropStatus() );                    remoteSyncStateStore.setBytes( changedResourcePair.getResource(), remoteInfo.asBytes() );                }					                //System.out.println(cmd.getRevision()+" "+changedResource+" R:"+status.getLastChangedRevision()+" L:"+status.getTextStatus()+" R:"+status.getRepositoryTextStatus());			}                        return result;        } catch (SVNClientException e) {            throw new TeamException("Error getting status for resource "+resource, e);        }    }