/** * Ensure that the sync info for all the provided resources has been loaded. If an out-of-sync * resource is found, prompt to refresh all the projects involved. */ protected boolean ensureSyncInfoLoaded(IResource[] resources) throws CVSException { boolean keepTrying = true; while (keepTrying) { try { EclipseSynchronizer.getInstance().ensureSyncInfoLoaded(resources, getActionDepth()); keepTrying = false; } catch (CVSException e) { if (e.getStatus().getCode() == IResourceStatus.OUT_OF_SYNC_LOCAL) { // determine the projects of the resources involved Set projects = new HashSet(); for (int i = 0; i < resources.length; i++) { IResource resource = resources[i]; projects.add(resource.getProject()); } // prompt to refresh if (promptToRefresh( getShell(), (IResource[]) projects.toArray(new IResource[projects.size()]), e.getStatus())) { for (Iterator iter = projects.iterator(); iter.hasNext(); ) { IProject project = (IProject) iter.next(); try { project.refreshLocal(IResource.DEPTH_INFINITE, null); } catch (CoreException coreException) { throw CVSException.wrapException(coreException); } } } else { return false; } } else { throw e; } } } return true; }