diff options
Diffstat (limited to 'bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources')
8 files changed, 231 insertions, 285 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java index 7e2d7fb8a..0d8bd1670 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java @@ -203,13 +203,11 @@ public class CVSRemoteSyncElement extends RemoteSyncElement { } else {
// We have conflicting deletions. Clear the sync info
local.setSyncInfo(null);
- local.saveSyncInfo(Policy.monitorFor(monitor));
return;
}
}
info = new ResourceSyncInfo(info.getName(), revision, ResourceSyncInfo.DUMMY_TIMESTAMP, info.getKeywordMode(), local.getParent().getFolderSyncInfo().getTag(), info.getPermissions());
local.setSyncInfo(info);
- local.saveSyncInfo(Policy.monitorFor(monitor));
}
/*
@@ -261,7 +259,6 @@ public class CVSRemoteSyncElement extends RemoteSyncElement { FolderSyncInfo remoteInfo = remote.getFolderSyncInfo();
FolderSyncInfo localInfo = local.getParent().getFolderSyncInfo();
local.setFolderSyncInfo(new FolderSyncInfo(remoteInfo.getRepository(), remoteInfo.getRoot(), localInfo.getTag(), localInfo.getIsStatic()));
- local.saveSyncInfo(Policy.monitorFor(monitor));
}
/*
* @see ILocalSyncElement#getSyncKind(int, IProgressMonitor)
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java index 515abf2ec..353a6938e 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java @@ -59,13 +59,14 @@ class EclipseFile extends EclipseResource implements ICVSFile { try { IFile file = getIFile(); if(resource.exists()) { - file.setContents(new ByteArrayInputStream(toByteArray()), true /*force*/, true /*keep history*/, null); + file.setContents(new ByteArrayInputStream(toByteArray()), false /*force*/, true /*keep history*/, null); } else { - file.create(new ByteArrayInputStream(toByteArray()), true /*force*/, null); + file.create(new ByteArrayInputStream(toByteArray()), false /*force*/, null); } - super.close(); } catch(CoreException e) { throw new IOException("Error setting file contents: " + e.getMessage()); + } finally { + super.close(); } } }; @@ -80,13 +81,14 @@ class EclipseFile extends EclipseResource implements ICVSFile { try { IFile file = getIFile(); if(resource.exists()) { - file.appendContents(new ByteArrayInputStream(toByteArray()), true /*force*/, true /*keep history*/, null); + file.appendContents(new ByteArrayInputStream(toByteArray()), false /*force*/, true /*keep history*/, null); } else { - file.create(new ByteArrayInputStream(toByteArray()), true /*force*/, null); + file.create(new ByteArrayInputStream(toByteArray()), false /*force*/, null); } - super.close(); } catch(CoreException e) { throw new IOException("Error setting file contents: " + e.getMessage()); + } finally { + super.close(); } } }; @@ -116,12 +118,7 @@ class EclipseFile extends EclipseResource implements ICVSFile { throw new CVSException(Policy.bind("LocalFile.invalidDateFormat", date), e); //$NON-NLS-1$ } } - getIOFile().setLastModified(millSec); - try { - resource.refreshLocal(IResource.DEPTH_ZERO, null); - } catch(CoreException e) { - throw CVSException.wrapException(e); - } + getIOFile().setLastModified(millSec); } /* diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java index c59aa6eeb..9806a8013 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java @@ -16,11 +16,16 @@ import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Path; -import org.eclipse.team.ccvs.core.*; -import org.eclipse.team.ccvs.core.CVSProviderPlugin; +import org.eclipse.team.ccvs.core.ICVSFile; +import org.eclipse.team.ccvs.core.ICVSFolder; +import org.eclipse.team.ccvs.core.ICVSResource; +import org.eclipse.team.ccvs.core.ICVSResourceVisitor; +import org.eclipse.team.ccvs.core.ICVSRunnable; import org.eclipse.team.internal.ccvs.core.CVSException; +import org.eclipse.team.internal.ccvs.core.Policy; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; @@ -240,4 +245,29 @@ class EclipseFolder extends EclipseResource implements ICVSFolder { } return null; } + + /* + * @see ICVSFolder#run(ICVSRunnable, IProgressMonitor) + */ + public void run(ICVSRunnable job, IProgressMonitor monitor) throws CVSException { + monitor = Policy.monitorFor(monitor); + try { + monitor.beginTask(null, 100); + try { + EclipseSynchronizer.getInstance().beginOperation(Policy.subMonitorFor(monitor, 5)); + job.run(Policy.subMonitorFor(monitor, 85)); + } finally { + EclipseSynchronizer.getInstance().endOperation(Policy.subMonitorFor(monitor, 8)); + try { + // this is temporary until core allows setting of timestamp via a + // IResource handle + resource.refreshLocal(IResource.DEPTH_INFINITE, Policy.subMonitorFor(monitor, 2)); + } catch(CoreException e) { + throw CVSException.wrapException(e); + } + } + } finally { + monitor.done(); + } + } }
\ No newline at end of file diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java index fc5f2b537..0fd4c2db8 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java @@ -118,25 +118,33 @@ abstract class EclipseResource implements ICVSResource { return false; } - // initialize matcher with global ignores and basic CVS ignore patterns - IIgnoreInfo[] ignorePatterns = TeamPlugin.getManager().getGlobalIgnore(); + // initialize matcher with global ignores, basic CVS ignore patterns, and ignore patterns + // from the .cvsignore file. FileNameMatcher matcher = new FileNameMatcher(SyncFileUtil.BASIC_IGNORE_PATTERNS); + String[] cvsIgnorePatterns;; + try { + cvsIgnorePatterns = EclipseSynchronizer.getInstance().getIgnored(resource); + } catch(CVSException e) { + cvsIgnorePatterns = null; + } + IIgnoreInfo[] ignorePatterns = TeamPlugin.getManager().getGlobalIgnore(); for (int i = 0; i < ignorePatterns.length; i++) { IIgnoreInfo info = ignorePatterns[i]; if(info.getEnabled()) { matcher.register(info.getPattern(), "true"); //$NON-NLS-1$ } } + if(cvsIgnorePatterns!=null) { + for (int i = 0; i < cvsIgnorePatterns.length; i++) { + matcher.register(cvsIgnorePatterns[i], "true"); + } + } - // 1. check CVS default patterns and global ignores + // check against all the registered patterns boolean ignored = matcher.match(getName()); - // 2. check .cvsignore file - if(!ignored) { - ignored = EclipseSynchronizer.getInstance().isIgnored(resource); - } - - // 3. check the parent + // check the parent, if the parent is ignored then this resource + // is ignored also if(!ignored) { ICVSFolder parent = getParent(); if(parent==null) return false; diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java index 56af1502c..6f72d7fce 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java @@ -27,12 +27,15 @@ import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.QualifiedName; import org.eclipse.team.ccvs.core.CVSProviderPlugin; import org.eclipse.team.ccvs.core.CVSTag; +import org.eclipse.team.ccvs.core.ICVSFile; import org.eclipse.team.ccvs.core.ICVSFolder; import org.eclipse.team.ccvs.core.ICVSResource; import org.eclipse.team.core.TeamPlugin; import org.eclipse.team.internal.ccvs.core.CVSException; +import org.eclipse.team.internal.ccvs.core.Policy; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; +import org.eclipse.team.internal.ccvs.core.util.Assert; import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter; /** @@ -43,7 +46,6 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter; * 1. how can we expire cache elements and purge to safe memory? * 2. how can we safeguard against overwritting meta files changes made outside of Eclipse? I'm * not sure we should force setting file contents in EclipseFile handles? - * 3. how can we group operations? * 4. how do we reload * ] * @@ -51,9 +53,16 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter; * @see FolderSyncInfo */ public class EclipseSynchronizer { + // the resources plugin synchronizer is used to cache and possibly persist. These + // are keys for storing the sync info. private static final QualifiedName FOLDER_SYNC_KEY = new QualifiedName(CVSProviderPlugin.ID, "folder-sync"); private static final QualifiedName RESOURCE_SYNC_KEY = new QualifiedName(CVSProviderPlugin.ID, "resource-sync"); + private static final QualifiedName IGNORE_SYNC_KEY = new QualifiedName(CVSProviderPlugin.ID, "folder-ignore"); + + // the cvs eclipse synchronizer is a singleton private static EclipseSynchronizer instance; + + // track resources that have changed in a given operation private int nestingCount = 0; private Set changedResources = new HashSet(); private Set changedFolders = new HashSet(); @@ -61,141 +70,110 @@ public class EclipseSynchronizer { private EclipseSynchronizer() { getSynchronizer().add(RESOURCE_SYNC_KEY); getSynchronizer().add(FOLDER_SYNC_KEY); + getSynchronizer().add(IGNORE_SYNC_KEY); } public static EclipseSynchronizer getInstance() { - if (instance == null) { + if (instance == null) { + ResourcesPlugin.getWorkspace().getSynchronizer().remove(RESOURCE_SYNC_KEY); + ResourcesPlugin.getWorkspace().getSynchronizer().remove(FOLDER_SYNC_KEY); + ResourcesPlugin.getWorkspace().getSynchronizer().remove(IGNORE_SYNC_KEY); instance = new EclipseSynchronizer(); } return instance; } - /** - * Associates the provided folder sync information with the given folder. The folder - * must exist on the file system. - * <p> - * The workbench and team plugins are notified that the state of this resources has - * changed.</p> - * - * @param file the file or folder for which to associate the sync info. - * @param info the folder sync to set. - * - * @throws CVSException if there was a problem adding sync info. - */ public void setFolderSync(IContainer folder, FolderSyncInfo info) throws CVSException { - beginOperation(); - setCachedFolderSync(folder, info); - changedFolders.add(folder); - endOperation(); + try { + beginOperation(null); + setCachedFolderSync(folder, info); + changedFolders.add(folder); + } finally { + endOperation(null); + } } - /** - * Answers the folder sync information associated with this folder or <code>null</code> - * if none is available. - * - * @param folder the folder for which to return folder sync info. - * @throws CVSException if there was a problem adding folder sync info. - */ public FolderSyncInfo getFolderSync(IContainer folder) throws CVSException { - if(folder.getType()==IResource.ROOT) return null; - beginOperation(); - FolderSyncInfo info = getCachedFolderSync(folder); - if (info == null) { - info = SyncFileWriter.readFolderConfig(CVSWorkspaceRoot.getCVSFolderFor(folder)); - if(info!=null) { - setCachedFolderSync(folder, info); - // read the child meta-files also - getMetaResourceSyncForFolder(folder, null); + try { + beginOperation(null); + if(folder.getType()==IResource.ROOT) return null; + FolderSyncInfo info = getCachedFolderSync(folder); + if (info == null) { + info = SyncFileWriter.readFolderConfig(CVSWorkspaceRoot.getCVSFolderFor(folder)); + if(info!=null) { + setCachedFolderSync(folder, info); + // read the child meta-files also + getMetaResourceSyncForFolder(folder, null); + } } + return info; + } finally { + endOperation(null); } - endOperation(); - return info; } - /** - * Associates the provided sync information with the given file or folder. The resource - * may or may not exist on the file system however the parent folder must be a cvs - * folder. - * <p> - * The workbench and team plugins are notified that the state of this resources has - * changed.</p> - * - * @param file the file or folder for which to associate the sync info. - * @param info to set. The name in the resource info must match the file or folder name. - * - * @throws CVSException if there was a problem adding sync info. - */ public void setResourceSync(IResource resource, ResourceSyncInfo info) throws CVSException { - beginOperation(); - setCachedResourceSync(resource, info); - changedResources.add(resource); - endOperation(); + try { + beginOperation(null); + setCachedResourceSync(resource, info); + changedResources.add(resource); + } finally { + endOperation(null); + } } - /** - * Answers the sync information associated with this file of folder or <code>null</code> - * if none is available. A resource cannot have sync information if its parent folder - * does not exist. - * - * @param file the file or folder for which to return sync info. - * @throws CVSException if there was a problem adding sync info or broadcasting - * the changes. - */ public ResourceSyncInfo getResourceSync(IResource resource) throws CVSException { - if(resource.getType()==IResource.ROOT) return null; - beginOperation(); - ResourceSyncInfo info = getCachedResourceSync(resource); - if(info==null) { - info = getMetaResourceSyncForFolder(resource.getParent(), resource); + try { + beginOperation(null); + if(resource.getType()==IResource.ROOT) return null; + ResourceSyncInfo info = getCachedResourceSync(resource); + if(info==null) { + info = getMetaResourceSyncForFolder(resource.getParent(), resource); + } + return info; + } finally { + endOperation(null); } - endOperation(); - return info; } - /** - * Removes the folder's and all children's folder sync information. This will essentially remove - * all CVS knowledge from these resources. - */ public void deleteFolderSync(IContainer folder, IProgressMonitor monitor) throws CVSException { - beginOperation(); - setCachedFolderSync(folder, null); - changedFolders.add(folder); - endOperation(); + try { + beginOperation(null); + setCachedFolderSync(folder, null); + changedFolders.add(folder); + } finally { + endOperation(null); + } } - /** - * Removes the resource's sync information. - */ public void deleteResourceSync(IResource resource, IProgressMonitor monitor) throws CVSException { - beginOperation(); - setCachedResourceSync(resource, null); - changedResources.add(resource); - endOperation(); + try { + beginOperation(null); + setCachedResourceSync(resource, null); + changedResources.add(resource); + } finally { + endOperation(null); + } } - /** - * Answers if the following resource is ignored - */ - public boolean isIgnored(IResource resource) { - return false; + public String[] getIgnored(IResource resource) throws CVSException { + IContainer parent = resource.getParent(); + if(parent==null || parent.getType()==IResource.ROOT) return null; + String[] ignores = getCachedFolderIgnores(parent); + if(ignores==null) { + ICVSFile ignoreFile = CVSWorkspaceRoot.getCVSFileFor(parent.getFile(new Path(SyncFileWriter.IGNORE_FILE))); + if(ignoreFile.exists()) { + ignores = SyncFileWriter.readLines(ignoreFile); + setCachedFolderIgnores(parent, ignores); + } + } + return ignores; } - /** - * Adds a pattern or file name to be ignored in the current files directory. - */ public void setIgnored(IResource resource, String pattern) throws CVSException { + SyncFileWriter.addCvsIgnoreEntry(CVSWorkspaceRoot.getCVSResourceFor(resource), pattern); } - - /** - * Answers an array with the sync information for immediate child resources of this folder. Note - * that the returned sync information may be for resources that no longer exist (e.g. in the - * case of a pending deletion). - * - * @param folder the folder for which to return the children resource sync infos. The folder - * must exist. - * - * @throws CVSException if an error occurs retrieving the sync info. - */ + public IResource[] members(IContainer folder) throws CVSException { try { // initialize cache if needed, this will create phantoms @@ -217,48 +195,58 @@ public class EclipseSynchronizer { } } - public void beginOperation() throws CVSException { + public void beginOperation(IProgressMonitor monitor) throws CVSException { if (nestingCount++ == 0) { - // any work here? - } + // any work here? + } } - public void endOperation() throws CVSException { - if (--nestingCount == 0) { + public void endOperation(IProgressMonitor monitor) throws CVSException { + if (--nestingCount == 0) { if (! changedFolders.isEmpty() || ! changedResources.isEmpty()) { - // write sync info to disk - Iterator it = changedFolders.iterator(); - while (it.hasNext()) { - IContainer folder = (IContainer) it.next(); - FolderSyncInfo info = getCachedFolderSync(folder); - ICVSFolder cvsFolder = CVSWorkspaceRoot.getCVSFolderFor(folder); - if (info != null) { - SyncFileWriter.writeFolderConfig(cvsFolder, info); - } else { - SyncFileWriter.deleteFolderSync(cvsFolder); + try { + monitor = Policy.monitorFor(monitor); + int numResources = changedFolders.size() + changedResources.size(); + monitor.beginTask("Updating CVS synchronization information...", numResources); + // write sync info to disk + Iterator it = changedFolders.iterator(); + while (it.hasNext()) { + IContainer folder = (IContainer) it.next(); + FolderSyncInfo info = getCachedFolderSync(folder); + ICVSFolder cvsFolder = CVSWorkspaceRoot.getCVSFolderFor(folder); + if (info != null) { + SyncFileWriter.writeFolderConfig(cvsFolder, info); + } else { + SyncFileWriter.deleteFolderSync(cvsFolder); + } + monitor.worked(1); } - } - it = changedResources.iterator(); - while (it.hasNext()) { - IResource resource = (IResource) it.next(); - ResourceSyncInfo info = getCachedResourceSync(resource); - ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource); - if (info != null) { - SyncFileWriter.writeResourceSync(cvsResource, info); - } else { - SyncFileWriter.deleteSync(cvsResource); + it = changedResources.iterator(); + while (it.hasNext()) { + IResource resource = (IResource) it.next(); + ResourceSyncInfo info = getCachedResourceSync(resource); + ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource); + if (info != null) { + SyncFileWriter.writeResourceSync(cvsResource, info); + } else { + SyncFileWriter.deleteSync(cvsResource); + } + monitor.worked(1); } + + // broadcast events + changedResources.addAll(changedFolders); + IResource[] resources = (IResource[]) changedResources.toArray( + new IResource[changedResources.size()]); + TeamPlugin.getManager().broadcastResourceStateChanges(resources); + changedResources.clear(); + changedFolders.clear(); + } finally { + monitor.done(); } - - // broadcast events - changedResources.addAll(changedFolders); - changedFolders.clear(); - IResource[] resources = (IResource[]) changedResources.toArray( - new IResource[changedResources.size()]); - TeamPlugin.getManager().broadcastResourceStateChanges(resources); - changedResources.clear(); } } + Assert.isTrue(nestingCount>= 0); } private static ISynchronizer getSynchronizer() { @@ -338,6 +326,47 @@ public class EclipseSynchronizer { } } + private String[] getCachedFolderIgnores(IContainer folder) throws CVSException { + try { + byte[] bytes = getSynchronizer().getSyncInfo(IGNORE_SYNC_KEY, folder); + if(bytes==null) { + return null; + } + DataInputStream is = new DataInputStream(new ByteArrayInputStream(bytes)); + int count = is.readInt(); + String[] ignoreList = new String[count]; + for(int i = 0; i < count; ++i) { + ignoreList[i] = is.readUTF(); + } + return ignoreList; + } catch (CoreException e) { + throw CVSException.wrapException(e); + } catch(IOException e) { + throw CVSException.wrapException(e); + } + } + + private void setCachedFolderIgnores(IContainer folder, String[] ignores) throws CVSException { + try { + if(ignores==null || ignores.length==0) { + getSynchronizer().flushSyncInfo(IGNORE_SYNC_KEY, folder, IResource.DEPTH_ZERO); + } else { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + DataOutputStream os = new DataOutputStream(bos); + os.writeInt(ignores.length); + for(int i = 0; i < ignores.length; ++i) { + os.writeUTF(ignores[i]); + } + getSynchronizer().setSyncInfo(IGNORE_SYNC_KEY, folder, bos.toByteArray()); + os.close(); + } + } catch (CoreException e) { + throw CVSException.wrapException(e); + } catch(IOException e) { + throw CVSException.wrapException(e); + } + } + /* * Reads and caches the ResourceSyncInfos for this folder. If target is non-null, then * returns the ResourceSync for this resource is it is found. diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSSynchronizer.java deleted file mode 100644 index 7ed3120be..000000000 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSSynchronizer.java +++ /dev/null @@ -1,122 +0,0 @@ -package org.eclipse.team.internal.ccvs.core.resources; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.io.File; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.team.internal.ccvs.core.CVSException; -import org.eclipse.team.internal.ccvs.core.syncinfo.*; - -/** - * A synchronizer is responsible for managing synchronization information for local - * CVS resources. - * - * @see ResourceSyncInfo - * @see FolderSyncInfo - */ -public interface ICVSSynchronizer { - - /** - * Associates the provided folder sync information with the given folder. The folder - * must exist on the file system. - * <p> - * The workbench and team plugins are notified that the state of this resources has - * changed.</p> - * - * @param file the file or folder for which to associate the sync info. - * @param info the folder sync to set. - * - * @throws CVSException if there was a problem adding sync info. - */ - public void setFolderSync(File folder, FolderSyncInfo info) throws CVSException; - - /** - * Answers the folder sync information associated with this folder or <code>null</code> - * if none is available. - * - * @param folder the folder for which to return folder sync info. - * @throws CVSException if there was a problem adding folder sync info. - */ - public FolderSyncInfo getFolderSync(File file) throws CVSException; - - /** - * Associates the provided sync information with the given file or folder. The resource - * may or may not exist on the file system however the parent folder must be a cvs - * folder. - * <p> - * The workbench and team plugins are notified that the state of this resources has - * changed.</p> - * - * @param file the file or folder for which to associate the sync info. - * @param info to set. The name in the resource info must match the file or folder name. - * - * @throws CVSException if there was a problem adding sync info. - */ - public void setResourceSync(File file, ResourceSyncInfo info) throws CVSException; - - /** - * Answers the sync information associated with this file of folder or <code>null</code> - * if none is available. A resource cannot have sync information if its parent folder - * does not exist. - * - * @param file the file or folder for which to return sync info. - * @throws CVSException if there was a problem adding sync info or broadcasting - * the changes. - */ - public ResourceSyncInfo getResourceSync(File file) throws CVSException; - - /** - * Removes the folder's and all children's folder sync information. This will essentially remove - * all CVS knowledge from these resources. - */ - public void deleteFolderSync(File file, IProgressMonitor monitor) throws CVSException; - - /** - * Removes the resource's sync information. - */ - public void deleteResourceSync(File file) throws CVSException; - - /** - * Answers if the following resource is ignored - */ - public boolean isIgnored(File file); - - /** - * Adds a pattern or file name to be ignored in the current files directory. - */ - public void setIgnored(File file, String pattern) throws CVSException; - - /** - * Allows the synchronizer to update the workspace with changes made by an 3rd - * party tool to the sync info. - */ - public void reload(File file, IProgressMonitor monitor) throws CVSException; - - /** - * Call to allow the synchronizer to save any pending or buffered changes and dispatch - * state change notifications. - */ - public void save(File file, IProgressMonitor monitor) throws CVSException; - - /** - * Answers an array with the sync information for immediate child resources of this folder. Note - * that the returned sync information may be for resources that no longer exist (e.g. in the - * case of a pending deletion). - * - * @param folder the folder for which to return the children resource sync infos. The folder - * must exist. - * - * @throws CVSException if an error occurs retrieving the sync info. - */ - public ResourceSyncInfo[] members(File folder) throws CVSException; - - /** - * XXX: Should be removed. Currently only used by tests and instead the tests should be - * created for the different types of concrete sync classes. - */ - public boolean isEmpty(); -}
\ No newline at end of file diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java index 6fc3a6b70..ce5f6fb7d 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java @@ -23,6 +23,7 @@ import org.eclipse.team.ccvs.core.ICVSRemoteFile; import org.eclipse.team.ccvs.core.ICVSRemoteFolder; import org.eclipse.team.ccvs.core.ICVSRemoteResource; import org.eclipse.team.ccvs.core.ICVSRepositoryLocation; +import org.eclipse.team.ccvs.core.ICVSRunnable; import org.eclipse.team.core.TeamException; import org.eclipse.team.core.sync.IRemoteResource; import org.eclipse.team.internal.ccvs.core.CVSException; @@ -603,4 +604,11 @@ public class RemoteFolder extends RemoteResource implements ICVSRemoteFolder, IC children = oldChildren; } } + + /* + * @see ICVSFolder#run(ICVSRunnable, IProgressMonitor) + */ + public void run(ICVSRunnable job, IProgressMonitor monitor) throws CVSException { + job.run(monitor); + } }
\ No newline at end of file diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java index b186d6202..73cf779d3 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java @@ -38,7 +38,6 @@ import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation; import org.eclipse.team.internal.ccvs.core.connection.CVSServerException; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; -import org.omg.CORBA.UNKNOWN; /* * This class is responsible for building a remote tree that shows the repository |