Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-02-28 16:12:14 -0500
committerJean Michel-Lemieux2002-02-28 16:12:14 -0500
commit0e3293fc6a815dfe4d2f6fcc9ebee53b9559ff22 (patch)
treed1068388a65cfbce3b9ae10a8835ea1d20902a1b
parentff4ccf5556ccf7ab43228bc3ad82c443c07bd759 (diff)
downloadeclipse.platform.team-0e3293fc6a815dfe4d2f6fcc9ebee53b9559ff22.tar.gz
eclipse.platform.team-0e3293fc6a815dfe4d2f6fcc9ebee53b9559ff22.tar.xz
eclipse.platform.team-0e3293fc6a815dfe4d2f6fcc9ebee53b9559ff22.zip
refactoring progress..
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java24
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java127
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java (renamed from bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSFile.java)167
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFolder.java (renamed from bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSFolder.java)190
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSProvider.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResource.java (renamed from bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSResource.java)283
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResourceVisitor.java (renamed from bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSResourceVisitor.java)36
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractMessageCommand.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java7
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java7
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AddStructureVisitor.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CheckedInHandler.java5
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java5
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java13
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CopyHandler.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/DiffStructureVisitor.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ExpandModules.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/FileStructureVisitor.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Import.java5
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ImportStructureVisitor.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/NewEntryHandler.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/PruneFolderVisitor.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RTag.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Remove.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java34
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Tag.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java5
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdatedHandler.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequests.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ICommandOutputListener.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleDefinitionsListener.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSLocalSyncElement.java1
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java13
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java109
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFile.java8
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseFolder.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseResource.java24
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalFile.java159
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalFolder.java264
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalResource.java219
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolder.java1
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTree.java1
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java (renamed from bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/RemoteFolderTreeBuilder.java)1110
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java3
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java17
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java30
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/OrphanedFolderListener.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java24
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java25
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSResourceNode.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java38
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RemoveRootAction.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithAction.java18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardEndPage.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java13
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardAutoconnectPage.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java6
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java6
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java10
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ReferenceClient.java6
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java6
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFileTest.java3
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFolderTest.java5
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/SynchronizerTest.java5
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CommandsTest.java8
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java22
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java15
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java8
95 files changed, 1363 insertions, 1977 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
index 824d4dd99..fa0f1f90e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProvider.java
@@ -33,10 +33,12 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSStatus;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSListener;
import org.eclipse.team.ccvs.core.ICVSProvider;
import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
@@ -56,7 +58,7 @@ import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.QuietOption;
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.resources.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTree;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
@@ -116,7 +118,7 @@ public class CVSProvider implements ICVSProvider {
project = ResourcesPlugin.getWorkspace().getRoot().getProject(new Path(sourceModule).lastSegment());
// Get the location of the workspace root
- ICVSFolder root = Session.getManagedFolder(ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile());
+ ICVSFolder root = (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(project.getParent());
// Build the local options
List localOptions = new ArrayList();
@@ -331,17 +333,7 @@ public class CVSProvider implements ICVSProvider {
}
- /**
- * Get the print stream to which information from CVS commands
- * is sent.
- */
- public PrintStream getPrintStream() {
- if (printStream == null)
- return System.out;
- else
- return printStream;
- }
-
+
/**
* @see ICVSProvider#getRepository(String)
*/
@@ -401,7 +393,7 @@ public class CVSProvider implements ICVSProvider {
}
// Set the folder sync info of the project to point to the remote module
- ICVSFolder folder = (ICVSFolder)Session.getManagedResource(project);
+ ICVSFolder folder = (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(project);
folder.setFolderSyncInfo(new FolderSyncInfo(moduleName, location.getLocation(), null, false));
// Register the project with Team
@@ -470,7 +462,7 @@ public class CVSProvider implements ICVSProvider {
public void setSharing(IProject project, FolderSyncInfo info, IProgressMonitor monitor) throws TeamException {
// Ensure provided info matches that of the project
- ICVSFolder folder = (ICVSFolder)Session.getManagedResource(project);
+ ICVSFolder folder = (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(project);
FolderSyncInfo folderInfo = folder.getFolderSyncInfo();
if ( ! info.equals(folderInfo)) {
throw new CVSException(new CVSStatus(CVSStatus.ERROR, Policy.bind("CVSProvider.infoMismatch", project.getName())));//$NON-NLS-1$
@@ -539,7 +531,7 @@ public class CVSProvider implements ICVSProvider {
ITeamProvider provider = manager.getProvider(projects[i]);
if (provider instanceof CVSTeamProvider) {
CVSTeamProvider cvsProvider = (CVSTeamProvider)provider;
- ICVSFolder folder = (ICVSFolder)Session.getManagedResource(projects[i]);
+ ICVSFolder folder = (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(projects[i]);
FolderSyncInfo info = folder.getFolderSyncInfo();
if (info != null) {
ICVSRepositoryLocation result = getRepository(info.getRoot());
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
index 7c1d05b3c..fdbf2ad12 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProviderPlugin.java
@@ -23,7 +23,7 @@ import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProvider;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.Command.QuietOption;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSSynchronizer;
+import org.eclipse.team.internal.ccvs.core.resources.*;
import org.eclipse.team.internal.ccvs.core.syncinfo.*;
import org.eclipse.team.internal.ccvs.core.syncinfo.FileSystemSynchronizer;
import org.eclipse.team.internal.ccvs.core.util.OrphanedFolderListener;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
index f12a519cb..854061189 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTeamProvider.java
@@ -24,7 +24,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.team.core.IFileTypeRegistry;
import org.eclipse.team.core.ITeamNature;
@@ -46,19 +45,13 @@ import org.eclipse.team.internal.ccvs.core.client.listeners.DiffListener;
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.resources.CVSRemoteSyncElement;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResourceVisitor;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
-import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
+import org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder;
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.RemoteFolderTreeBuilder;
/**
* This class acts as both the ITeamNature and the ITeamProvider instances
@@ -92,7 +85,7 @@ import org.eclipse.team.internal.ccvs.core.util.RemoteFolderTreeBuilder;
public class CVSTeamProvider implements ITeamNature, ITeamProvider {
// Instance variables
- private ICVSFolder managedProject;
+ private CVSWorkspaceRoot workspaceRoot;
private IProject project;
private String comment = ""; //$NON-NLS-1$
@@ -128,9 +121,9 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
public void setProject(IProject project) {
this.project = project;
try {
- this.managedProject = Session.getManagedFolder(project.getLocation().toFile());
+ this.workspaceRoot = new CVSWorkspaceRoot(project);
// Ensure that the project has CVS info
- if (managedProject.getFolderSyncInfo() == null) {
+ if (workspaceRoot.getLocalRoot().getFolderSyncInfo() == null) {
throw new CVSException(new CVSStatus(CVSStatus.ERROR, Policy.bind("CVSTeamProvider.noFolderInfo", project.getName()))); //$NON-NLS-1$
}
} catch (CVSException e) {
@@ -143,7 +136,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
* @see ITeamNature#getProvider()
*/
public ITeamProvider getProvider() throws TeamException {
- if (managedProject == null) {
+ if (workspaceRoot == null) {
// An error must have occured when we were configured
throw new TeamException(new Status(IStatus.ERROR, CVSProviderPlugin.ID, TeamException.UNABLE, Policy.bind("CVSTeamProvider.initializationFailed", new Object[]{project.getName()}), null)); //$NON-NLS-1$
}
@@ -247,7 +240,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
// Add the folders, followed by files!
IStatus status;
- Session s = new Session(getRemoteRoot(), managedProject);
+ Session s = new Session(workspaceRoot.getRemoteLocation(), workspaceRoot.getLocalRoot());
progress.beginTask(null, 100);
try {
// Opening the session takes 10% of the time
@@ -313,7 +306,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
// Commit the resources
IStatus status;
- Session s = new Session(getRemoteRoot(), managedProject);
+ Session s = new Session(workspaceRoot.getRemoteLocation(), workspaceRoot.getLocalRoot());
progress.beginTask(null, 100);
try {
// Opening the session takes 20% of the time
@@ -411,7 +404,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
// Remove the files remotely
IStatus status;
- Session s = new Session(getRemoteRoot(), managedProject);
+ Session s = new Session(workspaceRoot.getRemoteLocation(), workspaceRoot.getLocalRoot());
s.open(progress);
try {
status = Command.REMOVE.execute(s,
@@ -440,7 +433,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
String[] arguments = getValidArguments(resources, options);
IStatus status;
- Session s = new Session(getRemoteRoot(), managedProject);
+ Session s = new Session(workspaceRoot.getRemoteLocation(), workspaceRoot.getLocalRoot());
progress.beginTask(null, 100);
try {
s.open(Policy.subMonitorFor(progress, 20));
@@ -515,56 +508,11 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
*/
private ICVSResource getChild(IResource resource) throws CVSException {
if (resource.equals(project))
- return managedProject;
- return managedProject.getChild(resource.getFullPath().removeFirstSegments(1).toString());
- }
-
- /**
- * Answer the name of the connection method for the given resource's
- * project.
- */
- public String getConnectionMethod(IResource resource) throws TeamException {
- checkIsChild(resource);
- return getRemoteRoot().getMethod().getName();
- }
-
- /**
- * Get the print stream to which information from CVS commands
- * is sent.
- */
- private PrintStream getPrintStream() {
- return CVSProviderPlugin.getProvider().getPrintStream();
- }
-
- /**
- * Get the remote resource corresponding to the base of the local resource.
- * This method returns null if the corresponding local resource does not have a base.
- *
- * Use getRemoteSyncTree() to get the current remote state of HEAD or a branch.
- */
- public ICVSRemoteResource getRemoteResource(IResource resource) throws TeamException {
- checkIsChild(resource);
- ICVSResource managed = getChild(resource);
- if (managed.isFolder()) {
- ICVSFolder folder = (ICVSFolder)managed;
- if (folder.isCVSFolder()) {
- FolderSyncInfo syncInfo = folder.getFolderSyncInfo();
- return new RemoteFolder(null, CVSProvider.getInstance().getRepository(syncInfo.getRoot()), new Path(syncInfo.getRepository()), syncInfo.getTag());
- }
- } else {
- if (managed.isManaged())
- return RemoteFile.getBase((RemoteFolder)getRemoteResource(resource.getParent()), (ICVSFile)managed);
- }
- return null;
- }
-
- /**
- * Return the repository location to which the provider is connected
- */
- public ICVSRepositoryLocation getRemoteRoot() throws CVSException {
- return CVSProvider.getInstance().getRepository(managedProject.getFolderSyncInfo().getRoot());
+ return workspaceRoot.getLocalRoot();
+ return workspaceRoot.getLocalRoot().getChild(resource.getProjectRelativePath().toString());
}
+
/*
* Helper method that uses the parent of a local resource that has no base to ensure that the resource
* wasn't added remotely by a third party
@@ -574,10 +522,11 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
ICVSFolder parent = managed.getParent();
if (!parent.isCVSFolder()) {
// Check to make sure the project still has the CVS information
- if (managedProject.getFolderSyncInfo() == null) {
+ ICVSFolder root = workspaceRoot.getLocalRoot();
+ if (!root.isCVSFolder()) {
// This is a catastrophic error. The project should have CVS information
TeamPlugin.getManager().removeProvider(project, Policy.monitorFor(null));
- throw new CVSException(new CVSStatus(CVSStatus.ERROR, project.getFullPath(), Policy.bind("CVSTeamProvider.invalidProjectState", managedProject.getName()), null)); //$NON-NLS-1$
+ throw new CVSException(new CVSStatus(CVSStatus.ERROR, project.getFullPath(), Policy.bind("CVSTeamProvider.invalidProjectState", root.getName()), null)); //$NON-NLS-1$
} else {
throw new CVSException(new CVSStatus(CVSStatus.ERROR, resource.getFullPath(), Policy.bind("CVSTeamProvider.unmanagedParent", resource.getFullPath().toString()), null)); //$NON-NLS-1$
}
@@ -602,7 +551,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
public IRemoteSyncElement getRemoteSyncTree(IResource resource, CVSTag tag, IProgressMonitor progress) throws TeamException {
checkIsChild(resource);
ICVSResource managed = getChild(resource);
- ICVSRemoteResource remote = getRemoteResource(resource);
+ ICVSRemoteResource remote = workspaceRoot.getRemoteResourceFor(resource);
ICVSRemoteResource baseTree = null;
// The resource doesn't have a remote base.
@@ -611,7 +560,8 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
remote = getRemoteTreeFromParent(resource, managed, tag, progress);
} else if(resource.getType() == IResource.FILE) {
baseTree = remote;
- remote = RemoteFile.getLatest((RemoteFolder)getRemoteResource(resource.getParent()), (ICVSFile)managed, tag, progress);
+ ICVSRemoteResource remoteParent = workspaceRoot.getRemoteResourceFor(resource.getParent());
+ remote = RemoteFile.getLatest((RemoteFolder)remoteParent, (ICVSFile)managed, tag, progress);
} else {
ICVSRepositoryLocation location = remote.getRepository();
baseTree = RemoteFolderTreeBuilder.buildBaseTree((CVSRepositoryLocation)location, (ICVSFolder)managed, tag, progress);
@@ -623,11 +573,12 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
public ICVSRemoteResource getRemoteTree(IResource resource, CVSTag tag, IProgressMonitor progress) throws TeamException {
checkIsChild(resource);
ICVSResource managed = getChild(resource);
- ICVSRemoteResource remote = getRemoteResource(resource);
+ ICVSRemoteResource remote = workspaceRoot.getRemoteResourceFor(resource);
if (remote == null) {
remote = getRemoteTreeFromParent(resource, managed, tag, progress);
} else if(resource.getType() == IResource.FILE) {
- remote = RemoteFile.getLatest((RemoteFolder)getRemoteResource(resource.getParent()), (ICVSFile)managed, tag, progress);
+ ICVSRemoteResource remoteParent = workspaceRoot.getRemoteResourceFor(resource.getParent());
+ remote = RemoteFile.getLatest((RemoteFolder)remoteParent, (ICVSFile)managed, tag, progress);
} else {
ICVSRepositoryLocation location = remote.getRepository();
remote = RemoteFolderTreeBuilder.buildRemoteTree((CVSRepositoryLocation)location, (ICVSFolder)managed, tag, progress);
@@ -643,7 +594,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
public IUserInfo getUserInfo(IResource resource) throws TeamException {
checkIsChild(resource);
// Get the repository location for the receiver
- CVSRepositoryLocation location = (CVSRepositoryLocation)getRemoteRoot();
+ CVSRepositoryLocation location = (CVSRepositoryLocation)workspaceRoot.getRemoteLocation();
return location.getUserInfo(true);
}
@@ -674,17 +625,15 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
*/
public boolean hasRemote(IResource resource) {
try {
- LocalResource cvsResource;
+ ICVSResource cvsResource = workspaceRoot.getCVSResourceFor(resource);
int type = resource.getType();
if(type!=IResource.FILE) {
- cvsResource = new LocalFolder(resource.getLocation().toFile());
if(type==IResource.PROJECT) {
return ((ICVSFolder)cvsResource).isCVSFolder();
} else {
return cvsResource.isManaged();
}
} else {
- cvsResource = new LocalFile(resource.getLocation().toFile());
ResourceSyncInfo info = cvsResource.getSyncInfo();
if(info!=null) {
return !info.getRevision().equals(ResourceSyncInfo.ADDED_REVISION);
@@ -716,7 +665,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
* Helper to indicate if the resource is a child of the receiver's project
*/
private boolean isChildResource(IResource resource) {
- return resource.getProject().getName().equals(managedProject.getName());
+ return resource.getProject().getName().equals(project.getName());
}
/**
@@ -756,18 +705,12 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
/**
* @see ITeamProvider#move(IResource, IPath, IProgressMonitor)
*/
- public void moved(IPath source, IResource resource, IProgressMonitor progress)
- throws TeamException {
-
+ public void moved(IPath source, IResource resource, IProgressMonitor progress) throws TeamException {
+ // XXX
// this translates to a delete and an add
-
// How is this managed? Do we do the move or is that done after?
// It becomes complicated if the local and remote operations
// are independant as this is not the way CVS works!
-
- // Could implement a CVSProvider.MOVE!!!
-
- // XXX ????
}
/**
@@ -789,9 +732,9 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
if (!CVSRepositoryLocation.validateConnectionMethod(methodName))
return false;
-
+
// Get the original location
- ICVSRepositoryLocation location = getRemoteRoot();
+ ICVSRepositoryLocation location = workspaceRoot.getRemoteLocation();
// Make a copy to work on
CVSRepositoryLocation newLocation = CVSRepositoryLocation.fromString(location.getLocation());
@@ -825,7 +768,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
// Check if there is a differnece between the new and old roots
final String root = location.getLocation();
- if (root.equals(getRemoteRoot().getLocation()))
+ if (root.equals(workspaceRoot.getRemoteLocation()))
return;
try {
@@ -833,7 +776,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
monitor.beginTask(Policy.bind("CVSTeamProvider.folderInfo", project.getName()), 256); //$NON-NLS-1$
// Visit all the children folders in order to set the root in the folder sync info
- managedProject.accept(new ICVSResourceVisitor() {
+ workspaceRoot.getLocalRoot().accept(new ICVSResourceVisitor() {
public void visitFile(ICVSFile file) throws CVSException {};
public void visitFolder(ICVSFolder folder) throws CVSException {
monitor.worked(1);
@@ -881,7 +824,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
arguments = (String[])args.toArray(new String[args.size()]);
IStatus status;
- Session s = new Session(getRemoteRoot(), managedProject);
+ Session s = new Session(workspaceRoot.getRemoteLocation(), workspaceRoot.getLocalRoot());
progress.beginTask(null, 100);
try {
// Opening the session takes 20% of the time
@@ -942,7 +885,7 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
String[] arguments = getValidArguments(resources, commandOptions);
IStatus status;
- Session s = new Session(getRemoteRoot(), managedProject);
+ Session s = new Session(workspaceRoot.getRemoteLocation(), workspaceRoot.getLocalRoot());
progress.beginTask(null, 100);
try {
// Opening the session takes 20% of the time
@@ -1023,4 +966,8 @@ public class CVSTeamProvider implements ITeamNature, ITeamProvider {
Assert.isTrue(false);
return false;
}
+
+ public CVSWorkspaceRoot getCVSWorkspaceRoot() {
+ return workspaceRoot;
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java
index 995f59d81..20ad63336 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSFile.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFile.java
@@ -1,84 +1,85 @@
-package org.eclipse.team.internal.ccvs.core.resources;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-
-/**
- * The CVS analog of a file. CVS files have access to synchronization information
- * that describes their association with the CVS repository. CVS files also provide
- * mechanisms for sending and receiving content.
- *
- * @see ICVSResource
- */
-public interface ICVSFile extends ICVSResource {
-
- /**
- * Answers the size of the file.
- */
- long getSize();
-
- /**
- * Gets an input stream for reading from the file.
- * It is the responsibility of the caller to close the stream when finished.
- */
- InputStream getInputStream() throws CVSException;
-
- /**
- * Gets an output stream for writing to the file.
- * It is the responsibility of the caller to close the stream when finished.
- */
- OutputStream getOutputStream() throws CVSException;
-
- /**
- * Sets the file's read-only permission.
- */
- void setReadOnly(boolean readOnly) throws CVSException;
-
- /**
- * Move the resource to another location. Does overwrite without
- * promting.
- */
- void moveTo(String filename) throws CVSException;
-
- /**
- * Answers the current timestamp for this file. The returned format must be in the
- * following format:
- *
- * E MMM dd HH:mm:ss yyyy
- *
- * @throws CVSFileNotFoundException if exists() = false
- */
- String getTimeStamp() throws CVSFileNotFoundException;
-
- /**
- * Sets the current timestamp for this file. The supplied date must be in the
- * following format:
- *
- * E MMM dd HH:mm:ss yyyy
- *
- * If the date is <code>null</code> then the current time is used as
- * the timestamp.
- */
- void setTimeStamp(String date) throws CVSException;
-
- /**
- * Answers <code>true</code> if the file differs from its base. If the file has no
- * base, it is not dirty
- */
- boolean isDirty() throws CVSException;
-
- /**
- * Answers <code>true</code> if the file has changed since it was last updated
- * from the repository, if the file does not exist, or is not managed. And <code>false</code>
- * if it has not changed.
- */
- boolean isModified() throws CVSException;
+package org.eclipse.team.ccvs.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+
+/**
+ * The CVS analog of a file. CVS files have access to synchronization information
+ * that describes their association with the CVS repository. CVS files also provide
+ * mechanisms for sending and receiving content.
+ *
+ * @see ICVSResource
+ */
+public interface ICVSFile extends ICVSResource {
+
+ /**
+ * Answers the size of the file.
+ */
+ long getSize();
+
+ /**
+ * Gets an input stream for reading from the file.
+ * It is the responsibility of the caller to close the stream when finished.
+ */
+ InputStream getInputStream() throws CVSException;
+
+ /**
+ * Gets an output stream for writing to the file.
+ * It is the responsibility of the caller to close the stream when finished.
+ */
+ OutputStream getOutputStream() throws CVSException;
+
+ /**
+ * Sets the file's read-only permission.
+ */
+ void setReadOnly(boolean readOnly) throws CVSException;
+
+ /**
+ * Move the resource to another location. Does overwrite without
+ * promting.
+ */
+ void moveTo(String filename) throws CVSException;
+
+ /**
+ * Answers the current timestamp for this file. The returned format must be in the
+ * following format:
+ *
+ * E MMM dd HH:mm:ss yyyy
+ *
+ * @throws CVSFileNotFoundException if exists() = false
+ */
+ String getTimeStamp();
+
+ /**
+ * Sets the current timestamp for this file. The supplied date must be in the
+ * following format:
+ *
+ * E MMM dd HH:mm:ss yyyy
+ *
+ * If the date is <code>null</code> then the current time is used as
+ * the timestamp.
+ */
+ void setTimeStamp(String date) throws CVSException;
+
+ /**
+ * Answers <code>true</code> if the file differs from its base. If the file has no
+ * base, it is not dirty
+ */
+ boolean isDirty() throws CVSException;
+
+ /**
+ * Answers <code>true</code> if the file has changed since it was last updated
+ * from the repository, if the file does not exist, or is not managed. And <code>false</code>
+ * if it has not changed.
+ */
+ boolean isModified() throws CVSException;
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFolder.java
index f5dbd3ae5..a183caf7d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSFolder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSFolder.java
@@ -1,96 +1,96 @@
-package org.eclipse.team.internal.ccvs.core.resources;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.syncinfo.*;
-
-/**
- * The CVS analog of a directory. CVS folders have access to synchronization information
- * that describes the association between the folder and the remote repository.
- *
- * @see ICVSResource
- * @see ICVSFile
- */
-public interface ICVSFolder extends ICVSResource {
-
- /**
- * Answers the immediate folder children of this resource. This includes the union
- * of children that satisfy the following criteria:
- * <ul>
- * <li> exists but is not managed (not under CVS control)
- * <li> does not exist() but is managed (deleted folder)
- * <li> exist() and isManaged() (normal registered file)
- * </ul>
- * If the folder does not exist then a zero length array is returned.
- */
- ICVSFolder[] getFolders() throws CVSException;
-
- /**
- * Answers the immediate file children of this resource. This includes the union
- * of children that satisfy the following criteria:
- * <ul>
- * <li> exists but is not managed (not under CVS control)
- * <li> does not exist() but is managed (deleted file)
- * <li> exist() and isManaged() (normal registered file)
- * </ul>
- */
- ICVSFile[] getFiles() throws CVSException;
-
- /**
- * Answers a child folder of this resource with the given name or <code>null</code> if
- * the given folder does not have a child with that name.
- */
- ICVSFolder getFolder(String name) throws CVSException;
-
- /**
- * Answers a child file of this resource with the given name or <code>null</code> if
- * the given folder does not have a child with that name.
- */
- ICVSFile getFile(String name) throws CVSException;
-
- /**
- * Return the child resource at the given path relative to
- * the receiver.
- */
- ICVSResource getChild(String path) throws CVSException;
-
- /**
- * Create the folder if it did not exist before. Does only
- * work if the direct subfolder did exist.
- *
- * @throws CVSException if for some reason it was not possible to create the folder
- */
- void mkdir() throws CVSException;
-
- /**
- * Answers the folder's synchronization information or <code>null</code> if the folder
- * is not a CVS folder.
- * <p>
- * To modify the folder sync info the caller must call <code>setFolderSyncInfo</code> with
- * new sync information.</p>
- */
- FolderSyncInfo getFolderSyncInfo() throws CVSException;
-
- /**
- * Set the folder sync information for this folder. Setting the folder information
- * to <code>null</code> is not supported. The only mechanism for removing an existing
- * CVS folder is to delete the resource.
- */
- void setFolderSyncInfo(FolderSyncInfo folderInfo) throws CVSException;
-
- /**
- * Accepts the visitor on all files and all subFolder in the folder. Files are
- * visited first, then all the folders..
- */
- public void acceptChildren(ICVSResourceVisitor visitor) throws CVSException;
-
- /**
- * Answers <code>true</code> if the folder has CVS synchronization information and
- * <code>false</code> otherwise.
- */
- public boolean isCVSFolder();
+package org.eclipse.team.ccvs.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
+
+/**
+ * The CVS analog of a directory. CVS folders have access to synchronization information
+ * that describes the association between the folder and the remote repository.
+ *
+ * @see ICVSResource
+ * @see ICVSFile
+ */
+public interface ICVSFolder extends ICVSResource {
+
+ /**
+ * Answers the immediate folder children of this resource. This includes the union
+ * of children that satisfy the following criteria:
+ * <ul>
+ * <li> exists but is not managed (not under CVS control)
+ * <li> does not exist() but is managed (deleted folder)
+ * <li> exist() and isManaged() (normal registered file)
+ * </ul>
+ * If the folder does not exist then a zero length array is returned.
+ */
+ ICVSFolder[] getFolders() throws CVSException;
+
+ /**
+ * Answers the immediate file children of this resource. This includes the union
+ * of children that satisfy the following criteria:
+ * <ul>
+ * <li> exists but is not managed (not under CVS control)
+ * <li> does not exist() but is managed (deleted file)
+ * <li> exist() and isManaged() (normal registered file)
+ * </ul>
+ */
+ ICVSFile[] getFiles() throws CVSException;
+
+ /**
+ * Answers a child folder of this resource with the given name or <code>null</code> if
+ * the given folder does not have a child with that name.
+ */
+ ICVSFolder getFolder(String name) throws CVSException;
+
+ /**
+ * Answers a child file of this resource with the given name or <code>null</code> if
+ * the given folder does not have a child with that name.
+ */
+ ICVSFile getFile(String name) throws CVSException;
+
+ /**
+ * Return the child resource at the given path relative to
+ * the receiver.
+ */
+ ICVSResource getChild(String path) throws CVSException;
+
+ /**
+ * Create the folder if it did not exist before. Does only
+ * work if the direct subfolder did exist.
+ *
+ * @throws CVSException if for some reason it was not possible to create the folder
+ */
+ void mkdir() throws CVSException;
+
+ /**
+ * Answers the folder's synchronization information or <code>null</code> if the folder
+ * is not a CVS folder.
+ * <p>
+ * To modify the folder sync info the caller must call <code>setFolderSyncInfo</code> with
+ * new sync information.</p>
+ */
+ FolderSyncInfo getFolderSyncInfo() throws CVSException;
+
+ /**
+ * Set the folder sync information for this folder. Setting the folder information
+ * to <code>null</code> is not supported. The only mechanism for removing an existing
+ * CVS folder is to delete the resource.
+ */
+ void setFolderSyncInfo(FolderSyncInfo folderInfo) throws CVSException;
+
+ /**
+ * Accepts the visitor on all files and all subFolder in the folder. Files are
+ * visited first, then all the folders..
+ */
+ public void acceptChildren(ICVSResourceVisitor visitor) throws CVSException;
+
+ /**
+ * Answers <code>true</code> if the folder has CVS synchronization information and
+ * <code>false</code> otherwise.
+ */
+ public boolean isCVSFolder();
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSProvider.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSProvider.java
index 2877e9c39..0eb4f7d8b 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSProvider.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSProvider.java
@@ -140,11 +140,7 @@ public interface ICVSProvider {
*/
public String[] getSupportedConnectionMethods();
- /**
- * Get the stream to which command message and error output is sent
- */
- public PrintStream getPrintStream();
-
+
/**
* Set the print stream to which command message and error output is sent
*/
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResource.java
index b57ab8371..9d288a464 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSResource.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResource.java
@@ -1,137 +1,148 @@
-package org.eclipse.team.internal.ccvs.core.resources;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.syncinfo.*;
-
-/**
- * The CVS analog of file system files and directories. These are handles to
- * state maintained by a CVS client. That is, the CVS resource does not
- * actually contain data but rather represents CVS state and behavior. You are
- * free to manipulate handles for CVS resources that do not exist but be aware
- * that some methods require that an actual resource be available.
- * <p>
- * The CVS client has been designed to work on these handles uniquely. As such, the
- * handle could be to a remote resource or a local resource and the client could
- * perform CVS operations ignoring the actual location of the resources.</p>
- *
- * @see ICVSFolder
- * @see ICVSFile
- */
-public interface ICVSResource {
-
- /**
- * Answers the name of the resource.
- *
- * @return the name of the resource this handle represents. It can never
- * be <code>null</code>.
- */
- public String getName();
-
- /**
- * Answers if this resource has CVS synchronization information associated
- * with it.
- *
- * @return <code>true</code> if the resource is
- */
- public boolean isManaged();
-
- /**
- * Unmanage the given resource by purging any CVS synchronization associated with the
- * resource. The only way a resource can become managed is by running the
- * appropriate CVS commands (e.g. add/commit/update).
- */
- public void unmanage() throws CVSException;
-
- /**
- * Answer whether the resource could be ignored because it is in the one of the
- * ignore lists maintained by CVS. Even if a resource is ignored, it can still be
- * added to a repository, at which time it should never be ignored by the CVS
- * client.
- *
- * @return <code>true</code> if this resource is listed in one of the ignore
- * files maintained by CVS and <code>false</code> otherwise.
- */
- public boolean isIgnored();
-
- /**
- * Add the following file to the parent's ignore list
- */
- public void setIgnored() throws CVSException;
-
- /**
- * Add the following pattern to the file's parent ignore list
- */
- public void setIgnoredAs(String pattern) throws CVSException;
-
- /**
- * Answers if the handle is a file or a folder handle.
- *
- * @return <code>true</code> if this is a folder handle and <code>false</code> if
- * it is a file handle.
- */
- public boolean isFolder();
-
- /**
- * Answers if the resource identified by this handle exists.
- *
- * @return <code>true</code> if the resource represented by this handle
- * exists and <code>false</code> false otherwise.
- */
- public boolean exists() throws CVSException;
-
- /**
- * Answers the local relative path from the given ancestor to the receiver.
- *
- * @return the ancestor relative path for this resource.
- */
- public String getRelativePath(ICVSFolder ancestor) throws CVSException;
-
- /**
- * Get the remote location of a resource.
- *
- * @return the remote location.
- */
- public String getRemoteLocation(ICVSFolder stopSearching) throws CVSException;
-
- /**
- * Answers the workspace synchronization information for this resource. This would
- * typically include information from the <b>Entries</b> file that is used to track
- * the base revisions of local CVS resources.
- *
- * @return the synchronization information for this resource, or <code>null</code>
- * if the resource does not have synchronization information available.
- */
- public ResourceSyncInfo getSyncInfo() throws CVSException;
-
- /**
- * Called to set the workspace synchronization information for a resource. To
- * clear sync information call <code>unmanage</code>. The sync info will
- * become the persisted between workbench sessions.
- *
- * @param info the resource synchronization to associate with this resource.
- */
- public void setSyncInfo(ResourceSyncInfo info) throws CVSException;
-
- /**
- * Deletes the resource represented by the handle.
- */
- public void delete() throws CVSException;
-
- /**
- * Give the folder that contains this resource. If the resource is not managed
- * then the result of the operation is not specified.
- *
- * @return a handle to the parent of this resource.
- */
- public ICVSFolder getParent();
-
- /**
- * Accept a vistor to this resource.
- */
- public void accept(ICVSResourceVisitor visitor) throws CVSException;
+package org.eclipse.team.ccvs.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.syncinfo.*;
+
+/**
+ * The CVS analog of file system files and directories. These are handles to
+ * state maintained by a CVS client. That is, the CVS resource does not
+ * actually contain data but rather represents CVS state and behavior. You are
+ * free to manipulate handles for CVS resources that do not exist but be aware
+ * that some methods require that an actual resource be available.
+ * <p>
+ * The CVS client has been designed to work on these handles uniquely. As such, the
+ * handle could be to a remote resource or a local resource and the client could
+ * perform CVS operations ignoring the actual location of the resources.</p>
+ *
+ * @see ICVSFolder
+ * @see ICVSFile
+ */
+public interface ICVSResource {
+
+ /**
+ * Answers the name of the resource.
+ *
+ * @return the name of the resource this handle represents. It can never
+ * be <code>null</code>.
+ */
+ public String getName();
+
+ /**
+ * Answers if this resource has CVS synchronization information associated
+ * with it.
+ *
+ * @return <code>true</code> if the resource is
+ */
+ public boolean isManaged();
+
+ /**
+ * Unmanage the given resource by purging any CVS synchronization associated with the
+ * resource. The only way a resource can become managed is by running the
+ * appropriate CVS commands (e.g. add/commit/update).
+ */
+ public void unmanage() throws CVSException;
+
+ /**
+ * Answer whether the resource could be ignored because it is in the one of the
+ * ignore lists maintained by CVS. Even if a resource is ignored, it can still be
+ * added to a repository, at which time it should never be ignored by the CVS
+ * client.
+ *
+ * @return <code>true</code> if this resource is listed in one of the ignore
+ * files maintained by CVS and <code>false</code> otherwise.
+ */
+ public boolean isIgnored();
+
+ /**
+ * Add the following file to the parent's ignore list
+ */
+ public void setIgnored() throws CVSException;
+
+ /**
+ * Add the following pattern to the file's parent ignore list
+ */
+ public void setIgnoredAs(String pattern) throws CVSException;
+
+ /**
+ * Answers if the handle is a file or a folder handle.
+ *
+ * @return <code>true</code> if this is a folder handle and <code>false</code> if
+ * it is a file handle.
+ */
+ public boolean isFolder();
+
+ /**
+ * Answers if the resource identified by this handle exists.
+ *
+ * @return <code>true</code> if the resource represented by this handle
+ * exists and <code>false</code> false otherwise.
+ */
+ public boolean exists() throws CVSException;
+
+ /**
+ * Answers the local relative path from the given ancestor to the receiver.
+ *
+ * @return the ancestor relative path for this resource.
+ */
+ public String getRelativePath(ICVSFolder ancestor) throws CVSException;
+
+ /**
+ * Get the remote location of a resource.
+ *
+ * @return the remote location.
+ */
+ public String getRemoteLocation(ICVSFolder stopSearching) throws CVSException;
+
+ /**
+ * Answers the workspace synchronization information for this resource. This would
+ * typically include information from the <b>Entries</b> file that is used to track
+ * the base revisions of local CVS resources.
+ *
+ * @return the synchronization information for this resource, or <code>null</code>
+ * if the resource does not have synchronization information available.
+ */
+ public ResourceSyncInfo getSyncInfo() throws CVSException;
+
+ /**
+ * Called to set the workspace synchronization information for a resource. To
+ * clear sync information call <code>unmanage</code>. The sync info will
+ * become the persisted between workbench sessions.
+ *
+ * @param info the resource synchronization to associate with this resource.
+ */
+ public void setSyncInfo(ResourceSyncInfo info) throws CVSException;
+
+ /**
+ * Deletes the resource represented by the handle.
+ */
+ public void delete() throws CVSException;
+
+ /**
+ * Give the folder that contains this resource. If the resource is not managed
+ * then the result of the operation is not specified.
+ *
+ * @return a handle to the parent of this resource.
+ */
+ public ICVSFolder getParent();
+
+ /**
+ * Accept a vistor to this resource.
+ */
+ public void accept(ICVSResourceVisitor visitor) throws CVSException;
+
+ /**
+ * Reload sync info from for this resource and all child resources from disk
+ */
+ public void reloadSyncInfo(IProgressMonitor monitor) throws CVSException;
+
+ /**
+ * Save sync info from for this resource and all child resources from disk
+ */
+ public void saveSyncInfo(IProgressMonitor monitor) throws CVSException;
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSResourceVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResourceVisitor.java
index a61b0b6c4..c181ee8cc 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/ICVSResourceVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSResourceVisitor.java
@@ -1,19 +1,17 @@
-package org.eclipse.team.internal.ccvs.core.resources;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.team.internal.ccvs.core.CVSException;
-
-/**
- * Interface for an visitor of the IManagedResources.
- */
-public interface ICVSResourceVisitor {
-
- public void visitFile(ICVSFile file) throws CVSException;
- public void visitFolder(ICVSFolder folder) throws CVSException;
-
-}
-
+package org.eclipse.team.ccvs.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.team.internal.ccvs.core.CVSException;
+
+/**
+ * Interface for an visitor of the IManagedResources.
+ */
+public interface ICVSResourceVisitor {
+ public void visitFile(ICVSFile file) throws CVSException;
+ public void visitFolder(ICVSFolder folder) throws CVSException;
+}
+
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractMessageCommand.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractMessageCommand.java
index 7e5cba7b9..ae5b410c4 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractMessageCommand.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractMessageCommand.java
@@ -6,10 +6,11 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
/**
* Superclass for commands that do not change the structure on
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java
index 7dd8544b6..87c5db444 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AbstractStructureVisitor.java
@@ -6,12 +6,11 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.resources.CVSEntryLineTag;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResourceVisitor;
-import org.eclipse.team.internal.ccvs.core.syncinfo.*;
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;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java
index db81258e3..a50c0f01f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java
@@ -6,14 +6,15 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSStatus;
+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.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Assert;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AddStructureVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AddStructureVisitor.java
index eb664c723..fd5a10dbd 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AddStructureVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/AddStructureVisitor.java
@@ -9,9 +9,9 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.util.Assert;
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CheckedInHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CheckedInHandler.java
index bb655c8f4..9a7d0ced2 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CheckedInHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CheckedInHandler.java
@@ -6,10 +6,9 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.syncinfo.*;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
index 419e1b0fc..2213b5c9e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Checkout.java
@@ -7,8 +7,11 @@ package org.eclipse.team.internal.ccvs.core.client;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSStatus;
import org.eclipse.team.ccvs.core.CVSTag;
+import org.eclipse.team.ccvs.core.ICVSResource;
+import org.eclipse.team.ccvs.core.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
@@ -17,8 +20,6 @@ import org.eclipse.team.internal.ccvs.core.client.Command.Option;
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
import org.eclipse.team.internal.ccvs.core.client.listeners.ModuleDefinitionsListener;
import org.eclipse.team.internal.ccvs.core.connection.CVSServerException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.resources.RemoteModule;
import org.eclipse.team.internal.ccvs.core.util.Assert;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
index bbaf2f28c..45ab49512 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Command.java
@@ -18,13 +18,12 @@ import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSStatus;
import org.eclipse.team.ccvs.core.CVSTag;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
import org.eclipse.team.internal.ccvs.core.resources.CVSFileNotFoundException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
/**
* Abstract base class for the commands which implements the ICommand
@@ -312,9 +311,7 @@ public abstract class Command {
monitor = Policy.monitorFor(monitor);
monitor.beginTask(Policy.bind("Command.loadingSyncInfo"), 100 * resources.length);//$NON-NLS-1$
for (int i = 0; i < resources.length; i++) {
- if(resources[i] instanceof LocalResource && resources[i].exists()) {
- CVSProviderPlugin.getSynchronizer().reload(((LocalResource)resources[i]).getLocalFile(), Policy.subMonitorFor(monitor, 100));
- }
+ resources[i].reloadSyncInfo(Policy.subMonitorFor(monitor, 100));
}
} finally {
monitor.done();
@@ -332,9 +329,7 @@ public abstract class Command {
monitor = Policy.monitorFor(monitor);
monitor.beginTask(Policy.bind("Command.savingSyncInfo"), 100 * resources.length);//$NON-NLS-1$
for (int i = 0; i < resources.length; i++) {
- if(resources[i] instanceof LocalResource) {
- CVSProviderPlugin.getSynchronizer().save(((LocalResource)resources[i]).getLocalFile(), Policy.subMonitorFor(monitor, 100));
- }
+ resources[i].saveSyncInfo(Policy.subMonitorFor(monitor, 100));
}
} finally {
monitor.done();
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java
index 721d388c2..b11cf7375 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Commit.java
@@ -6,11 +6,11 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
public class Commit extends Command {
/*** Local options: specific to commit ***/
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CopyHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CopyHandler.java
index 210ade9ed..39387390f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CopyHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/CopyHandler.java
@@ -6,9 +6,9 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.util.Assert;
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java
index 5aa2b17e0..6a8183852 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Diff.java
@@ -7,12 +7,13 @@ package org.eclipse.team.internal.ccvs.core.client;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
import org.eclipse.team.internal.ccvs.core.connection.CVSServerException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
/**
* Runs the CVS diff command.
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/DiffStructureVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/DiffStructureVisitor.java
index 6d94c0b2c..c820db88b 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/DiffStructureVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/DiffStructureVisitor.java
@@ -4,10 +4,8 @@ package org.eclipse.team.internal.ccvs.core.client;
* All Rights Reserved.
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.syncinfo.*;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ExpandModules.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ExpandModules.java
index 9d8ffb4c7..66280a5cf 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ExpandModules.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ExpandModules.java
@@ -7,10 +7,11 @@ package org.eclipse.team.internal.ccvs.core.client;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
public class ExpandModules extends Command {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/FileStructureVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/FileStructureVisitor.java
index ca98df7ce..7db300be7 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/FileStructureVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/FileStructureVisitor.java
@@ -9,9 +9,9 @@ import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
/**
* This visitor send the fileStructure to the requestSender.
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Import.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Import.java
index 2a7ed6902..a0abe7784 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Import.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Import.java
@@ -6,11 +6,12 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.ccvs.core.ICVSResource;
+import org.eclipse.team.ccvs.core.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResourceVisitor;
public class Import extends Command {
/*** Local options: specific to import ***/
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ImportStructureVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ImportStructureVisitor.java
index 8db40237c..937114194 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ImportStructureVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ImportStructureVisitor.java
@@ -8,9 +8,9 @@ package org.eclipse.team.internal.ccvs.core.client;
import java.util.StringTokenizer;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.FileNameMatcher;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/NewEntryHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/NewEntryHandler.java
index 904815da8..679dbb116 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/NewEntryHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/NewEntryHandler.java
@@ -6,9 +6,9 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
public class NewEntryHandler extends ResponseHandler {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/PruneFolderVisitor.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/PruneFolderVisitor.java
index 30b3635ee..b58159f35 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/PruneFolderVisitor.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/PruneFolderVisitor.java
@@ -5,10 +5,10 @@ package org.eclipse.team.internal.ccvs.core.client;
* All Rights Reserved.
*/
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResourceVisitor;
/**
* Goes recursivly through the folders checks if they are empyty
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RTag.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RTag.java
index 251bae6df..0f6c5136d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RTag.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RTag.java
@@ -11,12 +11,13 @@ import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
public class RTag extends Command {
/*** Local options: specific to tag ***/
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Remove.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Remove.java
index 930328d51..a62719d94 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Remove.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Remove.java
@@ -6,10 +6,11 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
public class Remove extends Command {
/*** Local options: specific to remove ***/
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
index 49776b0a0..208fab03e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemoveEntryHandler.java
@@ -6,9 +6,9 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.util.Assert;
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
index 38b31032f..796161fa9 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/RemovedHandler.java
@@ -6,9 +6,9 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.util.Assert;
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
index f5fd6ebca..c01565358 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ResponseHandler.java
@@ -6,9 +6,10 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.resources.CVSEntryLineTag;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.syncinfo.*;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Util;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
index 722881b06..59e6974e5 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Session.java
@@ -6,7 +6,6 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import java.io.ByteArrayInputStream;
-import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -14,18 +13,15 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.connection.Connection;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
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.Util;
@@ -183,28 +179,6 @@ public class Session {
}
/**
- * Gives you an LocalFolder for a absolute path in
- * platform dependend style.
- *
- * @throws CVSException on path.indexOf("CVS") != -1
- * @throws CVSException on internal IOExeption
- */
- public static ICVSFolder getManagedFolder(File folder) throws CVSException {
- return new LocalFolder(folder);
- }
- public static ICVSFile getManagedFile(File file) throws CVSException {
- return new LocalFile(file);
- }
-
- public static ICVSResource getManagedResource(IResource resource) throws CVSException {
- File file = resource.getLocation().toFile();
- if (resource.getType() == IResource.FILE)
- return getManagedFile(file);
- else
- return getManagedFolder(file);
- }
-
- /**
* Returns the local root folder for this session.
* <p>
* Generally speaking, specifies the "current working directory" at
@@ -778,4 +752,6 @@ public class Session {
boolean isOutputToConsole() {
return outputToConsole;
}
+
+
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java
index 36c099bd4..16ff3baee 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StaticHandler.java
@@ -6,8 +6,9 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.syncinfo.*;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Assert;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java
index 00adcca10..b27dc6e9e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/StickyHandler.java
@@ -6,9 +6,10 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.resources.CVSEntryLineTag;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.syncinfo.*;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Assert;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Tag.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Tag.java
index aedbdb29c..2bb5e359e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Tag.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Tag.java
@@ -6,10 +6,11 @@ package org.eclipse.team.internal.ccvs.core.client;
*/
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
public class Tag extends Command {
/*** Local options: specific to tag ***/
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
index 9b874367c..2349f5214 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Update.java
@@ -9,15 +9,16 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSTag;
+import org.eclipse.team.ccvs.core.ICVSResource;
+import org.eclipse.team.ccvs.core.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
import org.eclipse.team.internal.ccvs.core.client.listeners.UpdateListener;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResourceVisitor;
public class Update extends Command {
/*** Local options: specific to update ***/
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdatedHandler.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdatedHandler.java
index 7dbf2f89e..602d0ed8a 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdatedHandler.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/UpdatedHandler.java
@@ -8,9 +8,9 @@ package org.eclipse.team.internal.ccvs.core.client;
import java.util.Date;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
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.EntryFileDateFormat;
@@ -78,7 +78,7 @@ class UpdatedHandler extends ResponseHandler {
boolean readOnly = permissionsLine.indexOf(READ_ONLY_FLAG) == -1;
session.receiveFile(mFile, binary, monitor);
- if (readOnly) mFile.setReadOnly();
+ if (readOnly) mFile.setReadOnly(true);
// Set the timestamp in the file, set the result in the fileInfo
String timestamp = null;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequests.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequests.java
index 1cfafb721..fe10f61f0 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequests.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/ValidRequests.java
@@ -1,10 +1,11 @@
package org.eclipse.team.internal.ccvs.core.client;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
/*
* (c) Copyright IBM Corp. 2000, 2002.
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java
index 2f972bd87..2a4e5fa04 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/DiffListener.java
@@ -9,8 +9,9 @@ import java.io.PrintStream;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSStatus;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSFolder;
public class DiffListener implements ICommandOutputListener {
PrintStream patchStream;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ICommandOutputListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ICommandOutputListener.java
index f29c8238c..642d40d2d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ICommandOutputListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ICommandOutputListener.java
@@ -7,9 +7,10 @@ package org.eclipse.team.internal.ccvs.core.client.listeners;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSStatus;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.Policy;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
public interface ICommandOutputListener {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
index 228bb299c..87a82a3a8 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java
@@ -10,10 +10,10 @@ import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
-import org.eclipse.team.internal.ccvs.core.client.listeners.LogEntry;
public class LogListener implements ICommandOutputListener {
private List entries;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleDefinitionsListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleDefinitionsListener.java
index 8a16a0566..78aa8134c 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleDefinitionsListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/ModuleDefinitionsListener.java
@@ -10,8 +10,9 @@ import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSStatus;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSFolder;
/*
* This class pares the output of the "cvs checkout -c" command which returns the list of modules
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java
index cda878cf5..b96d2859f 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener.java
@@ -9,8 +9,9 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSStatus;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSFolder;
public class StatusListener implements ICommandOutputListener {
private static boolean isFolder = false;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java
index 89a7c69cf..b90cf98e5 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/UpdateListener.java
@@ -10,11 +10,12 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSStatus;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Update;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
public class UpdateListener implements ICommandOutputListener {
static final String SERVER_PREFIX = "cvs server: "; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSLocalSyncElement.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSLocalSyncElement.java
index 43c8f92fd..f8af2d450 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSLocalSyncElement.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSLocalSyncElement.java
@@ -8,6 +8,7 @@ package org.eclipse.team.internal.ccvs.core.resources;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.core.sync.ILocalSyncElement;
import org.eclipse.team.core.sync.IRemoteResource;
import org.eclipse.team.core.sync.LocalSyncElement;
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 2601ebf00..baae9c0fa 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
@@ -9,7 +9,9 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.sync.ILocalSyncElement;
import org.eclipse.team.core.sync.IRemoteResource;
@@ -18,7 +20,6 @@ import org.eclipse.team.core.sync.RemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProvider;
import org.eclipse.team.internal.ccvs.core.Policy;
-import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
@@ -33,7 +34,7 @@ public class CVSRemoteSyncElement extends RemoteSyncElement {
public CVSRemoteSyncElement(boolean ignoreBaseTree, IResource local, IRemoteResource base, IRemoteResource remote) {
localSync = new CVSLocalSyncElement(local, base);
this.remote = remote;
- this.ignoreBaseTree = ignoreBaseTree;
+ this.ignoreBaseTree = ignoreBaseTree;
}
/*
@@ -201,13 +202,13 @@ public class CVSRemoteSyncElement extends RemoteSyncElement {
} else {
// We have conflicting deletions. Clear the sync info
local.setSyncInfo(null);
- CVSProviderPlugin.getSynchronizer().save(((LocalResource)local).getLocalFile(), Policy.monitorFor(monitor));
+ 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);
- CVSProviderPlugin.getSynchronizer().save(((LocalResource)local).getLocalFile(), Policy.monitorFor(monitor));
+ local.saveSyncInfo(Policy.monitorFor(monitor));
}
/*
@@ -218,7 +219,7 @@ public class CVSRemoteSyncElement extends RemoteSyncElement {
// To make outgoing deletions incoming, the local will not exist but
// it is still important to unmanage (e.g. delete all meta info) for the
// deletion.
- Session.getManagedResource(getLocal()).unmanage();
+ CVSWorkspaceRoot.getCVSResourceFor(getLocal()).unmanage();
}
/*
@@ -259,7 +260,7 @@ 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()));
- CVSProviderPlugin.getSynchronizer().save(((LocalResource)local).getLocalFile(), Policy.monitorFor(monitor));
+ 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/CVSWorkspaceRoot.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java
new file mode 100644
index 000000000..025b12364
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java
@@ -0,0 +1,109 @@
+package org.eclipse.team.internal.ccvs.core.resources;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2002.
+ * All Rights Reserved.
+ */
+
+import java.io.File;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
+import org.eclipse.team.ccvs.core.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.CVSProvider;
+import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
+
+public class CVSWorkspaceRoot {
+
+ private ICVSFolder localRoot;
+
+ public CVSWorkspaceRoot(IContainer resource){
+ this.localRoot = getCVSFolderFor(resource);
+ }
+
+/* public CVSWorkspaceRoot(File resource){
+ try {
+ this.localRoot = getCVSFolderFor(resource);
+ } catch(ClassCastException e) {
+ this.localRoot = null;
+ }
+ }
+*/
+ /*
+ * @see ICVSWorkspaceRoot#getCVSResourceFor(File)
+ */
+/* public static ICVSResource getCVSResourceFor(File resource) {
+ if (resource.exists()) {
+ if (resource.isDirectory()) {
+ return new LocalFolder(resource);
+ } else {
+ return new LocalFile(resource);
+ }
+ }
+ return null;
+ }
+*/
+ /*
+ * @see ICVSWorkspaceRoot#getRemoteResourceFor(IResource)
+ */
+ public static ICVSRemoteResource getRemoteResourceFor(IResource resource) throws CVSException {
+ ICVSResource managed = getCVSResourceFor(resource);
+ if (managed.isFolder()) {
+ ICVSFolder folder = (ICVSFolder)managed;
+ if (folder.isCVSFolder()) {
+ FolderSyncInfo syncInfo = folder.getFolderSyncInfo();
+ return new RemoteFolder(null, CVSProvider.getInstance().getRepository(syncInfo.getRoot()), new Path(syncInfo.getRepository()), syncInfo.getTag());
+ }
+ } else {
+ if (managed.isManaged())
+ return RemoteFile.getBase((RemoteFolder)getRemoteResourceFor(resource.getParent()), (ICVSFile)managed);
+ }
+ return null;
+ }
+
+ /*
+ * @see ICVSWorkspaceRoot#getRemoteRoot()
+ */
+ public ICVSRepositoryLocation getRemoteLocation() throws CVSException {
+ return CVSProvider.getInstance().getRepository(localRoot.getFolderSyncInfo().getRoot());
+ }
+
+ /*
+ * @see ICVSWorkspaceRoot#getLocalRoot()
+ */
+ public ICVSFolder getLocalRoot() {
+ return localRoot;
+ }
+
+ /**
+ * Gives you an LocalFolder for a absolute path in
+ * platform dependend style.
+ *
+ * @throws CVSException on path.indexOf("CVS") != -1
+ * @throws CVSException on internal IOExeption
+ */
+ public static ICVSFolder getCVSFolderFor(IContainer resource) {
+ return new EclipseFolder(resource);
+ }
+
+
+ public static ICVSFile getCVSFileFor(IFile resource) {
+ return new EclipseFile(resource);
+ }
+
+
+ public static ICVSResource getCVSResourceFor(IResource resource) {
+ if (resource.getType() == IResource.FILE)
+ return getCVSFileFor((IFile) resource);
+ else
+ return getCVSFolderFor((IContainer) resource);
+ }
+
+} \ No newline at end of file
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 bd5d77de3..b2957c444 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
@@ -15,8 +15,12 @@ import java.util.Date;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
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.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
@@ -26,7 +30,7 @@ import org.eclipse.team.internal.ccvs.core.util.EntryFileDateFormat;
* Represents handles to CVS resource on the local file system. Synchronization
* information is taken from the CVS subdirectories.
*/
-public class EclipseFile extends EclipseResource implements ICVSFile {
+class EclipseFile extends EclipseResource implements ICVSFile {
/**
* Create a handle based on the given local resource.
@@ -63,7 +67,7 @@ public class EclipseFile extends EclipseResource implements ICVSFile {
/*
* @see ICVSFile#getTimeStamp()
*/
- public String getTimeStamp() throws CVSFileNotFoundException {
+ public String getTimeStamp() {
EntryFileDateFormat timestamp = new EntryFileDateFormat();
return timestamp.format(new Date(getIOFile().lastModified()));
}
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 2c144d9b2..8e4a55bda 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,6 +16,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
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.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
@@ -27,7 +28,7 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
*
* @see ICVSFolder
*/
-public class EclipseFolder extends EclipseResource implements ICVSFolder {
+class EclipseFolder extends EclipseResource implements ICVSFolder {
protected EclipseFolder(IContainer container) {
super(container);
@@ -206,6 +207,9 @@ public class EclipseFolder extends EclipseResource implements ICVSFolder {
*/
public void setFolderSyncInfo(FolderSyncInfo folderInfo) throws CVSException {
CVSProviderPlugin.getSynchronizer().setFolderSync(getIOFile(), folderInfo);
+ // the server won't add directories as sync info, therefore it must be done when
+ // a directory is shared with the repository.
+ setSyncInfo(new ResourceSyncInfo(getName()));
}
/*
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 63907f38f..4ed893b12 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
@@ -10,7 +10,10 @@ import java.io.File;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.IIgnoreInfo;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.team.internal.ccvs.core.CVSException;
@@ -19,7 +22,6 @@ import org.eclipse.team.internal.ccvs.core.client.Session;
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.FileNameMatcher;
-import org.eclipse.team.internal.ccvs.core.util.FileUtil;
import org.eclipse.team.internal.ccvs.core.util.SyncFileUtil;
import org.eclipse.team.internal.ccvs.core.util.Util;
@@ -30,7 +32,7 @@ import org.eclipse.team.internal.ccvs.core.util.Util;
* @see LocalFolder
* @see LocalFile
*/
-public abstract class EclipseResource implements ICVSResource {
+abstract class EclipseResource implements ICVSResource {
// The seperator that must be used when creating CVS resource paths. Never use
// the platform default seperator since it is not compatible with CVS resources.
@@ -206,7 +208,9 @@ public abstract class EclipseResource implements ICVSResource {
* @see ICVSResource#setSyncInfo(ResourceSyncInfo)
*/
public void setSyncInfo(ResourceSyncInfo info) throws CVSException {
- CVSProviderPlugin.getSynchronizer().setResourceSync(getIOFile(), info);
+ if (getParent().isCVSFolder()) {
+ CVSProviderPlugin.getSynchronizer().setResourceSync(getIOFile(), info);
+ }
}
/*
@@ -230,4 +234,18 @@ public abstract class EclipseResource implements ICVSResource {
protected File getIOFile() {
return resource.getLocation().toFile();
}
+
+ /*
+ * @see ICVSResource#reloadSyncInfo(IProgressMonitor)
+ */
+ public void reloadSyncInfo(IProgressMonitor monitor) throws CVSException {
+ CVSProviderPlugin.getSynchronizer().reload(getIOFile(), monitor);
+ }
+
+ /*
+ * @see ICVSResource#saveSyncInfo(IProgressMonitor)
+ */
+ public void saveSyncInfo(IProgressMonitor monitor) throws CVSException {
+ CVSProviderPlugin.getSynchronizer().save(getIOFile(), monitor);
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalFile.java
deleted file mode 100644
index 95f647ca7..000000000
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalFile.java
+++ /dev/null
@@ -1,159 +0,0 @@
-package org.eclipse.team.internal.ccvs.core.resources;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.text.ParseException;
-import java.util.Date;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.team.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.Policy;
-import org.eclipse.team.internal.ccvs.core.syncinfo.*;
-import org.eclipse.team.internal.ccvs.core.util.EntryFileDateFormat;
-import org.eclipse.team.internal.ccvs.core.util.Util;
-
-/**
- * Represents handles to CVS resource on the local file system. Synchronization
- * information is taken from the CVS subdirectories.
- *
- * @see LocalFolder
- * @see LocalFile
- */
-public class LocalFile extends LocalResource implements ICVSFile {
- /**
- * Create a handle based on the given local resource.
- */
- protected LocalFile(File file) {
- super(file);
- }
-
- public long getSize() {
- return ioResource.length();
- }
-
- public InputStream getInputStream() throws CVSException {
- try {
- return new FileInputStream(ioResource);
- } catch (IOException e) {
- throw CVSException.wrapException(e);
- }
- }
-
- public OutputStream getOutputStream() throws CVSException {
- try {
- return new FileOutputStream(ioResource);
- } catch (IOException e) {
- throw CVSException.wrapException(e);
- }
- }
-
- public void setReadOnly(boolean readOnly) throws CVSException {
- if(readOnly) {
- ioResource.setReadOnly();
- }
- }
-
- public String getTimeStamp() throws CVSFileNotFoundException {
- EntryFileDateFormat timestamp = new EntryFileDateFormat();
- return timestamp.format(new Date(ioResource.lastModified()));
- }
-
- public void setTimeStamp(String date) throws CVSException {
- long millSec;
- if (date==null) {
- // get the current time
- millSec = new Date().getTime();
- } else {
- try {
- EntryFileDateFormat timestamp = new EntryFileDateFormat();
- millSec = timestamp.toDate(date).getTime();
- } catch (ParseException e) {
- throw new CVSException(Policy.bind("LocalFile.invalidDateFormat", date), e); //$NON-NLS-1$
- }
- }
- ioResource.setLastModified(millSec);
- }
-
- public boolean isFolder() {
- return false;
- }
-
- public boolean isDirty() throws CVSException {
- if (!exists() || !isManaged()) {
- return true;
- } else {
- ResourceSyncInfo info = getSyncInfo();
- if (info.isAdded()) return false;
- if (info.isDeleted()) return true;
- return !getTimeStamp().equals(info.getTimeStamp());
- }
- }
-
- public boolean isModified() throws CVSException {
- if (!exists() || !isManaged()) {
- return true;
- } else {
- ResourceSyncInfo info = getSyncInfo();
- return !getTimeStamp().equals(info.getTimeStamp());
- }
- }
-
- public void accept(ICVSResourceVisitor visitor) throws CVSException {
- visitor.visitFile(this);
- }
-
- /*
- * This is to be used by the Copy handler. The filename of the form .#filename
- */
- public void moveTo(String filename) throws CVSException {
-
- // Move the file to newFile (we know we do not need the
- // original any more anyway)
- // If this file exists then overwrite it
- LocalFile file;
- try {
- file = (LocalFile)getParent().getFile(filename);
- } catch(ClassCastException e) {
- throw CVSException.wrapException(e);
- }
-
- // We are deleting the old .#filename if it exists
- if (file.exists()) {
- file.delete();
- }
-
- boolean success = ioResource.renameTo(file.getFile());
-
- if (!success) {
- throw new CVSException(Policy.bind("LocalFile.moveFailed", ioResource.toString(), file.toString())); //$NON-NLS-1$
- }
- }
-
- File getFile() {
- return ioResource;
- }
-
- /**
- * @see ICVSResource#getRemoteLocation()
- */
- public String getRemoteLocation(ICVSFolder stopSearching) throws CVSException {
- return getParent().getRemoteLocation(stopSearching) + SEPARATOR + getName();
- }
- /*
- * @see ICVSResource#unmanage()
- */
- public void unmanage() throws CVSException {
- CVSProviderPlugin.getSynchronizer().deleteResourceSync(ioResource);
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalFolder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalFolder.java
deleted file mode 100644
index 9911a74b2..000000000
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalFolder.java
+++ /dev/null
@@ -1,264 +0,0 @@
-package org.eclipse.team.internal.ccvs.core.resources;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import java.io.File;
-import java.io.FileFilter;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.team.ccvs.core.CVSProviderPlugin;
-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;
-
-/**
- * Implements the ICVSFolder interface on top of an
- * instance of the ICVSFolder interface
- *
- * @see ICVSFolder
- */
-public class LocalFolder extends LocalResource implements ICVSFolder {
-
- protected LocalFolder(File ioResource) {
- super(ioResource);
- }
-
- /**
- *
- * @see ICVSFolder#getFolders()
- */
- public ICVSFolder[] getFolders() throws CVSException {
-
- if(!getLocalFile().exists()) {
- return new ICVSFolder[0];
- }
-
- final List folders = new ArrayList();
-
- ResourceSyncInfo[] syncDirs = CVSProviderPlugin.getSynchronizer().members(ioResource);
- for (int i = 0; i < syncDirs.length; i++) {
- if(syncDirs[i].isDirectory()) {
- folders.add((new LocalFolder(new File(ioResource, syncDirs[i].getName()))));
- }
- }
-
- File[] realDirs = ioResource.listFiles(new FileFilter() {
- public boolean accept(File file) {
- if(file.isDirectory()) {
- LocalFolder cvsFolder = new LocalFolder(file);
- if(!cvsFolder.isIgnored() && !folders.contains(cvsFolder)) {
- folders.add(cvsFolder);
- }
- }
- return false;
- }
- });
-
- return (ICVSFolder[]) folders.toArray(new ICVSFolder[folders.size()]);
- }
-
- /**
- * @see ICVSFolder#getFiles()
- */
- public ICVSFile[] getFiles() throws CVSException {
-
- if(!getLocalFile().exists()) {
- return new ICVSFile[0];
- }
-
- final List files = new ArrayList();
-
- ResourceSyncInfo[] syncDirs = CVSProviderPlugin.getSynchronizer().members(ioResource);
- for (int i = 0; i < syncDirs.length; i++) {
- if(!syncDirs[i].isDirectory()) {
- files.add((new LocalFile(new File(ioResource, syncDirs[i].getName()))));
- }
- }
-
- File[] realDirs = ioResource.listFiles(new FileFilter() {
- public boolean accept(File file) {
- if(!file.isDirectory()) {
- LocalFile cvsFile = new LocalFile(file);
- if(!cvsFile.isIgnored() && !files.contains(cvsFile)) {
- files.add(cvsFile);
- }
- }
- return false;
- }
- });
- return (ICVSFile[]) files.toArray(new ICVSFile[files.size()]);
- }
-
- /**
- * @see ICVSFolder#createFolder(String)
- */
- public ICVSFolder getFolder(String name) throws CVSException {
- if ((CURRENT_LOCAL_FOLDER.equals(name)) || ((CURRENT_LOCAL_FOLDER + SEPARATOR).equals(name)))
- return this;
- return new LocalFolder(new File(ioResource, name));
- }
-
- /**
- * @see ICVSFolder#createFile(String)
- */
- public ICVSFile getFile(String name) throws CVSException {
- return new LocalFile(new File(ioResource, name));
- }
-
- /**
- * @see ICVSFolder#getChild(String)
- */
- public ICVSResource getChild(String name) throws CVSException {
-
- boolean isDirectory;
-
- File child = new File(ioResource, name);
- if(child.exists()) {
- isDirectory = child.isDirectory();
- } else {
- LocalFile localFile = new LocalFile(child);
- ResourceSyncInfo info = localFile.getSyncInfo();
- if (info == null)
- throw new CVSFileNotFoundException(Policy.bind("LocalFolder.invalidChild", child.getAbsolutePath())); //$NON-NLS-1$
- isDirectory = info.isDirectory();
- }
-
- if(isDirectory) {
- return getFolder(name);
- } else {
- return getFile(name);
- }
- }
- /**
- * @see ICVSFolder#mkdir()
- */
- public void mkdir() throws CVSException {
- ioResource.mkdir();
- }
-
- /**
- * @see ICVSResource#isFolder()
- */
- public boolean isFolder() {
- return true;
- }
-
-// /**
-// * Remove the fileInfo for a specific file. If it was not there
-// * before nothing happens.
-// *
-// * @param file has to satisfy file.getParent().equals(this)
-// */
-// void removeFileInfo(IManagedFile file) throws CVSException {
-//
-// Assert.isTrue(file.getParent().equals(this));
-//
-// fileInfoContainer.removeFileInfo(file.getName());
-// }
-
- /**
- * @see ICVSFolder#acceptChildren(ICVSResourceVisitor)
- */
- public void acceptChildren(ICVSResourceVisitor visitor) throws CVSException {
-
- ICVSResource[] subFiles;
- ICVSResource[] subFolders;
-
- subFiles = getFiles();
- subFolders = getFolders();
-
- for (int i=0; i<subFiles.length; i++) {
- subFiles[i].accept(visitor);
- }
-
- for (int i=0; i<subFolders.length; i++) {
- subFolders[i].accept(visitor);
- }
- }
-
- /**
- * @see ICVSResource#accept(ICVSResourceVisitor)
- */
- public void accept(ICVSResourceVisitor visitor) throws CVSException {
- visitor.visitFolder(this);
- }
-
- /**
- * @see ICVSResource#getRemoteLocation(ICVSFolder)
- */
- public String getRemoteLocation(ICVSFolder stopSearching) throws CVSException {
-
- String parentLocation;
-
- if (getFolderSyncInfo() != null) {
- return getFolderSyncInfo().getRemoteLocation();
- }
-
- if (equals(stopSearching)) {
- return null;
- }
-
- parentLocation = getParent().getRemoteLocation(stopSearching);
- if (parentLocation == null) {
- return null;
- } else {
- return parentLocation + SEPARATOR + getName();
- }
-
- }
-
- /*
- * @see ICVSFolder#childExists(String)
- */
- public boolean childExists(String path) {
- return false;
- }
-
- /*
- * @see ICVSFolder#getFolderInfo()
- */
- public FolderSyncInfo getFolderSyncInfo() throws CVSException {
- return CVSProviderPlugin.getSynchronizer().getFolderSync(ioResource);
- }
-
- /*
- * @see ICVSFolder#setFolderInfo(FolderSyncInfo)
- */
- public void setFolderSyncInfo(FolderSyncInfo folderInfo) throws CVSException {
- CVSProviderPlugin.getSynchronizer().setFolderSync(ioResource, folderInfo);
- }
-
- /*
- * @see ICVSFolder#isCVSFolder()
- */
- public boolean isCVSFolder() {
- try {
- return CVSProviderPlugin.getSynchronizer().getFolderSync(ioResource) != null;
- } catch(CVSException e) {
- return false;
- }
- }
-
- /*
- * @see ICVSResource#unmanage()
- */
- public void unmanage() throws CVSException {
- CVSProviderPlugin.getSynchronizer().deleteFolderSync(ioResource, new NullProgressMonitor());
- }
-
- /*
- * @see ICVSResource#isIgnored()
- */
- public boolean isIgnored() {
- if(isCVSFolder()) {
- return false;
- }
- return super.isIgnored();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalResource.java
deleted file mode 100644
index b619a8650..000000000
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/LocalResource.java
+++ /dev/null
@@ -1,219 +0,0 @@
-package org.eclipse.team.internal.ccvs.core.resources;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import java.io.File;
-
-import org.eclipse.team.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.core.IIgnoreInfo;
-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.client.Session;
-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.FileNameMatcher;
-import org.eclipse.team.internal.ccvs.core.util.FileUtil;
-import org.eclipse.team.internal.ccvs.core.util.SyncFileUtil;
-import org.eclipse.team.internal.ccvs.core.util.Util;
-
-/**
- * Represents handles to CVS resource on the local file system. Synchronization
- * information is taken from the CVS subdirectories.
- *
- * @see LocalFolder
- * @see LocalFile
- */
-public abstract class LocalResource implements ICVSResource {
-
- // The seperator that must be used when creating CVS resource paths. Never use
- // the platform default seperator since it is not compatible with CVS resources.
- protected static final String SEPARATOR = Session.SERVER_SEPARATOR;
- protected static final String CURRENT_LOCAL_FOLDER = Session.CURRENT_LOCAL_FOLDER;
-
- /**
- * The local file represented by this handle.
- */
- File ioResource;
-
- /**
- * A local handle
- */
- protected LocalResource(File ioResource) {
- Assert.isNotNull(ioResource);
- this.ioResource = ioResource;
- }
-
- /**
- * Get the extention of the path of resource
- * relative to the path of root
- *
- * @throws CVSException if root is not a root-folder of resource
- */
- public String getRelativePath(ICVSFolder root)
- throws CVSException {
-
- LocalResource rootFolder;
- String result;
-
- try {
- rootFolder = (LocalResource)root;
- } catch (ClassCastException e) {
- throw new CVSException(Policy.bind("LocalResource.invalidResourceClass"),e); //$NON-NLS-1$
- }
-
- result = Util.getRelativePath(rootFolder.getPath(),getPath());
- return result;
- }
-
- /**
- * Do a DEEP delete.
- * @see ICVSResource#delete()
- */
- public void delete() {
- FileUtil.deepDelete(ioResource);
- // XXX Should we clear the cache in all cases?
- // XXX If not, should we provide a boolean parameter as a choice
- }
-
- /**
- * @see ICVSResource#exists()
- */
- public boolean exists() {
- return ioResource.exists();
- }
-
- /**
- * @see ICVSResource#getParent()
- */
- public ICVSFolder getParent() {
- File parentFile = ioResource.getParentFile();
- if (parentFile == null) return null;
- return new LocalFolder(parentFile);
- }
-
- /**
- * @see ICVSResource#getName()
- */
- public String getName() {
- return ioResource.getName();
- }
-
- /**
- * @see ICVSResource#isIgnored()
- */
- public boolean isIgnored() {
- // a managed resource is never ignored
- if(isManaged()) {
- return false;
- }
-
- // initialize matcher with global ignores and basic CVS ignore patterns
- IIgnoreInfo[] ignorePatterns = TeamPlugin.getManager().getGlobalIgnore();
- FileNameMatcher matcher = new FileNameMatcher(SyncFileUtil.BASIC_IGNORE_PATTERNS);
- for (int i = 0; i < ignorePatterns.length; i++) {
- IIgnoreInfo info = ignorePatterns[i];
- if(info.getEnabled()) {
- matcher.register(info.getPattern(), "true"); //$NON-NLS-1$
- }
- }
-
- // 1. check CVS default patterns and global ignores
- boolean ignored = matcher.match(ioResource.getName());
-
- // 2. check .cvsignore file
- if(!ignored) {
- ignored = CVSProviderPlugin.getSynchronizer().isIgnored(ioResource);
- }
-
- // 3. check the parent
- if(!ignored) {
- ICVSFolder parent = getParent();
- if(parent==null) return false;
- return parent.isIgnored();
- } else {
- return ignored;
- }
- }
-
- public void setIgnored() throws CVSException {
- CVSProviderPlugin.getSynchronizer().setIgnored(ioResource, null);
- }
-
- public void setIgnoredAs(String pattern) throws CVSException {
- CVSProviderPlugin.getSynchronizer().setIgnored(ioResource, pattern);
- }
-
- /**
- * @see ICVSResource#isManaged()
- */
- public boolean isManaged() {
- try {
- return getSyncInfo() != null;
- } catch(CVSException e) {
- return false;
- }
- }
-
- /**
- * Two ManagedResources are equal, if there cvsResources are
- * equal (and that is, if the point to the same file)
- */
- public boolean equals(Object obj) {
-
- if (!(obj instanceof LocalResource)) {
- return false;
- } else {
- return getPath().equals(((LocalResource) obj).getPath());
- }
- }
-
- /*
- * @see ICVSResource#getPath()
- */
- public String getPath() {
- return ioResource.getAbsolutePath();
- }
-
- /*
- * @see ICVSResource#isFolder()
- */
- public boolean isFolder() {
- return false;
- }
-
- /*
- * @see ICVSResource#getSyncInfo()
- */
- public ResourceSyncInfo getSyncInfo() throws CVSException {
- return CVSProviderPlugin.getSynchronizer().getResourceSync(ioResource);
- }
-
- /*
- * @see ICVSResource#setSyncInfo(ResourceSyncInfo)
- */
- public void setSyncInfo(ResourceSyncInfo info) throws CVSException {
- CVSProviderPlugin.getSynchronizer().setResourceSync(ioResource, info);
- }
-
- /*
- * Implement the hashcode on the underlying strings, like it is done in the equals.
- */
- public int hashCode() {
- return getPath().hashCode();
- }
-
- /*
- * Give the pathname back
- */
- public String toString() {
- return getPath();
- }
-
- public File getLocalFile() {
- return ioResource;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java
index ebc2f958c..869f6fc75 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFile.java
@@ -16,6 +16,7 @@ import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSStatus;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.ICVSRemoteFile;
@@ -326,7 +327,7 @@ public class RemoteFile extends RemoteResource implements ICVSRemoteFile, ICVSFi
/**
* @see IManagedFile#getTimeStamp()
*/
- public String getTimeStamp() throws CVSFileNotFoundException {
+ public String getTimeStamp() {
return info.getTimeStamp();
}
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 a86058f4d..6fc3a6b70 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
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSStatus;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.ICVSRemoteFile;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTree.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTree.java
index 2bf59497e..9fb0013c4 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTree.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTree.java
@@ -7,6 +7,7 @@ package org.eclipse.team.internal.ccvs.core.resources;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/RemoteFolderTreeBuilder.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
index 10ce7a171..b186d6202 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/RemoteFolderTreeBuilder.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteFolderTreeBuilder.java
@@ -1,556 +1,554 @@
-package org.eclipse.team.internal.ccvs.core.util;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.team.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.ccvs.core.CVSStatus;
-import org.eclipse.team.ccvs.core.CVSTag;
-import org.eclipse.team.ccvs.core.ICVSRemoteResource;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.Policy;
-import org.eclipse.team.internal.ccvs.core.client.Command;
-import org.eclipse.team.internal.ccvs.core.client.Session;
-import org.eclipse.team.internal.ccvs.core.client.Update;
-import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
-import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.client.listeners.IStatusListener;
-import org.eclipse.team.internal.ccvs.core.client.listeners.IUpdateMessageListener;
-import org.eclipse.team.internal.ccvs.core.client.listeners.StatusListener;
-import org.eclipse.team.internal.ccvs.core.client.listeners.UpdateListener;
-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.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
-import org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTree;
-import org.eclipse.team.internal.ccvs.core.resources.RemoteResource;
-import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
-import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
-
-/*
- * This class is responsible for building a remote tree that shows the repository
- * state of a locally loaded folder tree.
- *
- * It is used as follows
- *
- * RemoteFolderTreeBuilder.buildRemoteTree(CVSRepositoryLocation, IManagedFolder, String, IProgressMonitor);
- *
- * The provider IManagedFolder can be a local resource or a RemoteFolderTree that
- * that was previously built.
- */
-public class RemoteFolderTreeBuilder {
-
- private Map fileDeltas;
- private List changedFiles;
- private Map remoteFolderTable;
-
- private ICVSFolder root;
- private RemoteFolderTree remoteRoot;
- private CVSRepositoryLocation repository;
-
- private CVSTag tag;
-
- private LocalOption[] updateLocalOptions;
-
- private boolean projectDoesNotExist = false;
-
- private static String UNKNOWN = ""; //$NON-NLS-1$
- private static String DELETED = "DELETED"; //$NON-NLS-1$
- private static String ADDED = "ADDED"; //$NON-NLS-1$
- private static String FOLDER = "FOLDER"; //$NON-NLS-1$
-
- private static Map EMPTY_MAP = new HashMap();
-
- static class DeltaNode {
- int syncState = Update.STATE_NONE;
- String name;
- String revision;
-
- DeltaNode(String name, String revision, int syncState) {
- this.name = name;
- this.revision = revision;
- this.syncState = syncState;
- }
-
- String getName() {
- return name;
- }
-
- String getRevision() {
- return revision;
- }
-
- int getSyncState() {
- return syncState;
- }
- }
-
-
- private RemoteFolderTreeBuilder(CVSRepositoryLocation repository, ICVSFolder root, CVSTag tag) {
- this.repository = repository;
- this.root = root;
- this.tag = tag;
- this.fileDeltas = new HashMap();
- this.changedFiles = new ArrayList();
- this.remoteFolderTable = new HashMap();
-
- // Build the local options
- List localOptions = new ArrayList();
- localOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES);
- if (tag != null) {
- if (tag.getType() == CVSTag.HEAD) {
- localOptions.add(Update.CLEAR_STICKY);
- } else {
- localOptions.add(Update.makeTagOption(tag));
- }
- }
- updateLocalOptions = (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]);
- }
-
- private LocalOption[] getOptionsWithoutTag() {
- // Build the local options
- List localOptions = new ArrayList();
- localOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES);
- return (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]);
- }
-
- public static RemoteFolderTree buildBaseTree(CVSRepositoryLocation repository, ICVSFolder root, CVSTag tag, IProgressMonitor monitor) throws CVSException {
- RemoteFolderTreeBuilder builder = new RemoteFolderTreeBuilder(repository, root, tag);
- return builder.buildBaseTree(null, root, monitor);
- }
-
- public static RemoteFolderTree buildRemoteTree(CVSRepositoryLocation repository, IContainer root, CVSTag tag, IProgressMonitor monitor) throws CVSException {
- return buildRemoteTree(repository, Session.getManagedFolder(root.getLocation().toFile()), tag, monitor);
- }
-
- public static RemoteFolderTree buildRemoteTree(CVSRepositoryLocation repository, ICVSFolder root, CVSTag tag, IProgressMonitor monitor) throws CVSException {
- RemoteFolderTreeBuilder builder = new RemoteFolderTreeBuilder(repository, root, tag);
- return builder.buildTree(monitor);
- }
-
- private RemoteFolderTree buildTree(IProgressMonitor monitor) throws CVSException {
- Session session = new Session(repository, root, false);
- session.open(monitor);
- try {
- fetchDelta(session, monitor);
- if (projectDoesNotExist) {
- return null;
- }
- } finally {
- session.close();
- }
- // FIXME: We need a second session because of the use of a different handle on the same remote resource
- // We didn't need one before!!! Perhaps we could support the changing of a sessions root as long as
- // the folder sync info is the same
- remoteRoot =
- new RemoteFolderTree(null, root.getName(), repository,
- new Path(root.getFolderSyncInfo().getRepository()),
- tagForRemoteFolder(root, tag));
- session = new Session(repository, remoteRoot, false);
- session.open(monitor);
- try {
- buildRemoteTree(session, root, remoteRoot, Path.EMPTY, monitor);
- if (!changedFiles.isEmpty())
- fetchFileRevisions(session, (String[])changedFiles.toArray(new String[changedFiles.size()]), monitor);
- return remoteRoot;
- } finally {
- session.close();
- }
- }
-
- /*
- * Build the base remote tree from the local tree.
- *
- * The localPath is used to retrieve deltas from the recorded deltas
- *
- */
- private RemoteFolderTree buildBaseTree(RemoteFolderTree parent, ICVSFolder local, IProgressMonitor monitor) throws CVSException {
-
- // Create a remote folder tree corresponding to the local resource
- RemoteFolderTree remote = new RemoteFolderTree(parent, local.getName(), repository, new Path(local.getFolderSyncInfo().getRepository()), local.getFolderSyncInfo().getTag());
-
- // Create a List to contain the created children
- List children = new ArrayList();
-
- // Build the child folders corresponding to local folders base
- ICVSFolder[] folders = local.getFolders();
- for (int i=0;i<folders.length;i++) {
- if (folders[i].isManaged() && folders[i].isCVSFolder()) {
- children.add(buildBaseTree(remote, folders[i], monitor));
- }
- }
-
- // Build the child files corresponding to local files base
- ICVSFile[] files = local.getFiles();
- for (int i=0;i<files.length;i++) {
- ICVSFile file = files[i];
- ResourceSyncInfo info = file.getSyncInfo();
- // if there is no sync info then there is no base
- if (info==null)
- continue;
- // There is no remote if the file was added
- if (info.isAdded())
- continue;
- // If the file was deleted locally, we need to generate a new sync info without the delete flag
- if (info.isDeleted())
- info = new ResourceSyncInfo(info.getName(), info.getRevision(), info.getTimeStamp(), info.getKeywordMode(), info.getTag(), info.getPermissions());
- children.add(new RemoteFile(remote, info));
- }
-
- // Add the children to the remote folder tree
- remote.setChildren((ICVSRemoteResource[])children.toArray(new ICVSRemoteResource[children.size()]));
-
- return remote;
- }
-
- /*
- * Build the remote tree from the local tree and the recorded deltas.
- *
- * The localPath is used to retrieve deltas from the recorded deltas
- *
- */
- private void buildRemoteTree(Session session, ICVSFolder local, RemoteFolderTree remote, IPath localPath, IProgressMonitor monitor) throws CVSException {
-
- // Add the remote folder to the remote folder lookup table (used to update file revisions)
- remoteFolderTable.put(remote.getFolderSyncInfo().getRemoteLocation(), remote);
-
- // Create a map to contain the created children
- Map children = new HashMap();
-
- // If there's no corresponding local resource then we need to fetch its contents in order to populate the deltas
- if (local == null) {
- fetchNewDirectory(session, remote, localPath, monitor);
- }
-
- // Fetch the delta's for the folder
- Map deltas = (Map)fileDeltas.get(localPath);
- if (deltas == null)
- deltas = EMPTY_MAP;
-
- // If there is a local, use the local children to start buidling the remote children
- if (local != null) {
- // Build the child folders corresponding to local folders
- ICVSFolder[] folders = local.getFolders();
- for (int i=0;i<folders.length;i++) {
- DeltaNode d = (DeltaNode)deltas.get(folders[i].getName());
- if (folders[i].isCVSFolder() && ! isOrphanedSubtree(session, folders[i]) && (d==null || d.getRevision() != DELETED)) {
- children.put(folders[i].getName(),
- new RemoteFolderTree(remote, folders[i].getName(), repository,
- new Path(folders[i].getFolderSyncInfo().getRepository()),
- tagForRemoteFolder(folders[i],tag)));
- }
- }
- // Build the child files corresponding to local files
- ICVSFile[] files = local.getFiles();
- for (int i=0;i<files.length;i++) {
- ICVSFile file = files[i];
-
- DeltaNode d = (DeltaNode)deltas.get(file.getName());
- ResourceSyncInfo info = file.getSyncInfo();
- // if there is no sync info then there isn't a remote file for this local file on the
- // server.
- if (info==null)
- continue;
- // There is no remote if the file was added and we didn't get a conflict (C) indicator from the server
- if (info.isAdded() && d==null)
- continue;
- // There is no remote if the file was deleted and we didn;t get a remove (R) indicator from the server
- if (info.isDeleted() && d==null)
- continue;
-
- int type = d==null ? Update.STATE_NONE : d.getSyncState();
- children.put(file.getName(), new RemoteFile(remote, type, info));
- }
- }
-
- // Build the children for new or out-of-date resources from the deltas
- Iterator i = deltas.keySet().iterator();
- while (i.hasNext()) {
- String name = (String)i.next();
- DeltaNode d = (DeltaNode)deltas.get(name);
- String revision = d.getRevision();
- if (revision == FOLDER) {
- // XXX should getRemotePath() return an IPath instead of a String?
- children.put(name, new RemoteFolderTree(remote, repository,
- new Path(remote.getRepositoryRelativePath()).append(name),
- tagForRemoteFolder(remote, tag)));
- } else if (revision == ADDED) {
- children.put(name, new RemoteFile(remote, d.getSyncState(), name, tagForRemoteFolder(remote, tag)));
- } else if (revision == UNKNOWN) {
- // The local resource is out of sync with the remote.
- // Create a RemoteFile associated with the tag so we are assured of getting the proper revision
- // (Note: this will replace the RemoteFile added from the local base)
- children.put(name, new RemoteFile(remote, d.getSyncState(), name, tagForRemoteFolder(remote, tag)));
- } else if (revision == DELETED) {
- // This should have been deleted while creating from the local resources.
- // If it wasn't, delete it now.
- if (children.containsKey(name))
- children.remove(name);
- } else {
- // We should never get here
- }
- }
-
- // Add the children to the remote folder tree
- remote.setChildren((ICVSRemoteResource[])children.values().toArray(new ICVSRemoteResource[children.size()]));
-
- // We have to delay building the child folders to support the proper fetching of new directories
- // due to the fact that the same CVS home directory (i.e. the same root directory) must
- // be used for all requests sent over the same connection
- Iterator childIterator = children.entrySet().iterator();
- List emptyChildren = new ArrayList();
- while (childIterator.hasNext()) {
- Map.Entry entry = (Map.Entry)childIterator.next();
- if (((RemoteResource)entry.getValue()).isFolder()) {
- RemoteFolderTree remoteFolder = (RemoteFolderTree)entry.getValue();
- String name = (String)entry.getKey();
- ICVSFolder localFolder;
- DeltaNode d = (DeltaNode)deltas.get(name);
- // for directories that are new on the server
- if (d!=null && d.getRevision() == FOLDER)
- localFolder = null;
- else
- localFolder = local.getFolder(name);
- buildRemoteTree(session, localFolder, remoteFolder, localPath.append(name), monitor);
- // Record any children that are empty
- if (pruneEmptyDirectories() && remoteFolder.getChildren().length == 0) {
- // Prune if the local folder is also empty.
- if (localFolder == null || (localFolder.getFiles().length == 0 && localFolder.getFolders().length == 0))
- emptyChildren.add(remoteFolder);
- else {
- // Also prune if the tag we are fetching is not HEAD and differs from the tag of the local folder
- FolderSyncInfo info = localFolder.getFolderSyncInfo();
- if (tag != null && info != null && ! tag.equals(CVSTag.DEFAULT) && ! tag.equals(info.getTag()))
- emptyChildren.add(remoteFolder);
- }
- }
- }
- }
-
- // Prune any empty child folders
- if (pruneEmptyDirectories() && !emptyChildren.isEmpty()) {
- List newChildren = new ArrayList();
- newChildren.addAll(Arrays.asList(remote.getChildren()));
- newChildren.removeAll(emptyChildren);
- remote.setChildren((ICVSRemoteResource[])newChildren.toArray(new ICVSRemoteResource[newChildren.size()]));
-
- }
- }
-
- /*
- * This method fetches the delta between the local state and the remote state of the resource tree
- * and records the deltas in the fileDeltas instance variable
- *
- * Returns the list of changed files
- */
- private List fetchDelta(Session session, IProgressMonitor monitor) throws CVSException {
-
- // Create an listener that will accumulate new and removed files and folders
- final List newChildDirectories = new ArrayList();
- IUpdateMessageListener listener = new IUpdateMessageListener() {
- public void directoryInformation(IPath path, boolean newDirectory) {
- if (newDirectory) {
- // Record new directory with parent so it can be retrieved when building the parent
- recordDelta(path, FOLDER, Update.STATE_NONE);
- // Record new directory to be used as a parameter to fetch its contents
- newChildDirectories.add(path.toString());
- }
- }
- public void directoryDoesNotExist(IPath path) {
- // Record removed directory with parent so it can be removed when building the parent
- if (path.isEmpty()) {
- projectDoesNotExist = true;
- } else {
- recordDelta(path, DELETED, Update.STATE_NONE);
- }
- }
- public void fileInformation(int type, String filename) {
- // Cases that do not require action are:
- // case 'A' : = A locally added file that does not exists remotely
- // case '?' : = A local file that has not been added and does not exists remotely
- // case 'M' : = A locally modified file that has not been modified remotely
- switch(type) {
- case Update.STATE_MERGEABLE_CONFLICT :
- case Update.STATE_CONFLICT :
- // We have an remote change to a modified local file
- // The change could be a local change conflicting with a remote deletion.
- // If so, the deltas may already have a DELETED for the file.
- // We shouldn't override this DELETED
- IPath filePath = new Path(filename);
- Map deltas = deltas = (Map)fileDeltas.get(filePath.removeLastSegments(1));
- DeltaNode d = deltas != null ? (DeltaNode)deltas.get(filePath.lastSegment()) : null;
- if ((d!=null) && (d.getRevision() == DELETED))
- break;
- case Update.STATE_DELETED : // We have a locally removed file that still exists remotely
- case Update.STATE_REMOTE_CHANGES : // We have an remote change to an unmodified local file
- changedFiles.add(filename);
- recordDelta(new Path(filename), UNKNOWN, type);
- break;
- }
- }
- public void fileDoesNotExist(String filename) {
- recordDelta(new Path(filename), DELETED, Update.STATE_NONE);
- }
- };
-
- // Perform a "cvs -n update -d [-r tag] ." in order to get the
- // messages from the server that will indicate what has changed on the
- // server.
- IStatus status = Command.UPDATE.execute(session,
- new GlobalOption[] { Command.DO_NOT_CHANGE },
- updateLocalOptions,
- new String[] { Session.CURRENT_LOCAL_FOLDER },
- new UpdateListener(listener),
- monitor);
- return changedFiles;
- }
-
- private void fetchNewDirectory(Session session, RemoteFolderTree newFolder, IPath localPath, IProgressMonitor monitor) throws CVSException {
-
- // Create an listener that will accumulate new files and folders
- IUpdateMessageListener listener = new IUpdateMessageListener() {
- public void directoryInformation(IPath path, boolean newDirectory) {
- if (newDirectory) {
- // Record new directory with parent so it can be retrieved when building the parent
- // NOTE: Check path prefix
- recordDelta(path, FOLDER, Update.STATE_NONE);
- }
- }
- public void directoryDoesNotExist(IPath path) {
- }
- public void fileInformation(int type, String filename) {
- // NOTE: Check path prefix
- changedFiles.add(filename);
- recordDelta(new Path(filename), ADDED, type);
- }
- public void fileDoesNotExist(String filename) {
- }
- };
-
- // NOTE: Should use the path relative to the remoteRoot
- IPath path = new Path(newFolder.getRepositoryRelativePath());
- IStatus status = Command.UPDATE.execute(session,
- new GlobalOption[] { Command.DO_NOT_CHANGE },
- updateLocalOptions,
- new String[] { localPath.toString() },
- new UpdateListener(listener),
- monitor);
- if (status.getCode() == CVSStatus.SERVER_ERROR) {
- // FIXME: This should be refactored (maybe static methods on CVSException?)
- CVSServerException e = new CVSServerException(status);
- if ( ! e.isNoTagException() && e.containsErrors())
- throw e;
- // we now know that this is an exception caused by a cvs bug.
- // if the folder has no files in it (just subfolders) cvs does not respond with the subfolders...
- // workaround: retry the request with no tag to get the directory names (if any)
- Policy.checkCanceled(monitor);
- status = Command.UPDATE.execute(session,
- new GlobalOption[] { Command.DO_NOT_CHANGE },
- getOptionsWithoutTag(),
- new String[] { localPath.toString() },
- new UpdateListener(listener),
- monitor);
- if (status.getCode() == CVSStatus.SERVER_ERROR) {
- throw new CVSServerException(status);
- }
- }
- }
-
- // Get the file revisions for the given filenames
- private void fetchFileRevisions(Session session, String[] fileNames, IProgressMonitor monitor) throws CVSException {
-
- // Create a listener for receiving the revision info
- final int[] count = new int[] {0};
- final Map revisions = new HashMap();
- IStatusListener listener = new IStatusListener() {
- public void fileStatus(IPath path, String remoteRevision) {
- try {
- updateRevision(path, remoteRevision);
- count[0]++;
- } catch (CVSException e) {
- // The count will be off which will trigger another exception
- CVSProviderPlugin.log(e);
- }
- }
- };
-
- // Perform a "cvs status..." with a custom message handler
- IStatus status = Command.STATUS.execute(session,
- Command.NO_GLOBAL_OPTIONS,
- Command.NO_LOCAL_OPTIONS,
- fileNames,
- new StatusListener(listener),
- monitor);
- if (status.getCode() == CVSStatus.SERVER_ERROR) {
- throw new CVSServerException(status);
- }
-
- // XXX we can't make this check because it may be valid to call this method
- // without any file names (e.g. fileNames array empty) which would run the
- // status on all files.
- //if (count[0] != fileNames.length)
- // throw new CVSException(Policy.bind("RemoteFolder.errorFetchingRevisions"));
- }
-
- private boolean pruneEmptyDirectories() {
- return CVSProviderPlugin.getPlugin().getPruneEmptyDirectories();
- }
- /*
- * Record the deltas in a double map where the outer key is the parent directory
- * and the inner key is the file name. The value is the revision of the file or
- * DELETED (file or folder). New folders have a revision of FOLDER.
- *
- * A revison of UNKNOWN indicates that the revision has not been fetched
- * from the repository yet.
- */
- private void recordDelta(IPath path, String revision, int syncState) {
- IPath parent = path.removeLastSegments(1);
- Map deltas = (Map)fileDeltas.get(parent);
- if (deltas == null) {
- deltas = new HashMap();
- fileDeltas.put(parent, deltas);
- }
- String name = path.lastSegment();
- deltas.put(name, new DeltaNode(name, revision, syncState));
- }
-
- private void updateRevision(IPath path, String revision) throws CVSException {
- RemoteFolderTree folder = (RemoteFolderTree)remoteFolderTable.get(path.removeLastSegments(1).toString());
- ((RemoteFile)folder.getFile(path.lastSegment())).setRevision(revision);
- }
-
- /*
- * Return the tag that should be associated with a remote folder.
- *
- * This method is used to ensure that new directories contain the tag
- * derived from the parant local folder when appropriate. For instance,
- *
- * The tag should be the provided tag. However, if tag is null, the
- * tag for the folder should be derived from the provided reference folder
- * which could be the local resource corresponding to the remote or the parent
- * of the remote.
- */
- private CVSTag tagForRemoteFolder(ICVSFolder folder, CVSTag tag) throws CVSException {
- return tag == null ? folder.getFolderSyncInfo().getTag() : tag;
- }
-
- private boolean isOrphanedSubtree(Session session, ICVSFolder mFolder) {
- return mFolder.isCVSFolder() && ! mFolder.isManaged() && ! mFolder.equals(session.getLocalRoot()) && mFolder.getParent().isCVSFolder();
- }
-}
-
+package org.eclipse.team.internal.ccvs.core.resources;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2002.
+ * All Rights Reserved.
+ */
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.CVSStatus;
+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.ICVSRemoteResource;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.Policy;
+import org.eclipse.team.internal.ccvs.core.client.Command;
+import org.eclipse.team.internal.ccvs.core.client.Session;
+import org.eclipse.team.internal.ccvs.core.client.Update;
+import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
+import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
+import org.eclipse.team.internal.ccvs.core.client.listeners.IStatusListener;
+import org.eclipse.team.internal.ccvs.core.client.listeners.IUpdateMessageListener;
+import org.eclipse.team.internal.ccvs.core.client.listeners.StatusListener;
+import org.eclipse.team.internal.ccvs.core.client.listeners.UpdateListener;
+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
+ * state of a locally loaded folder tree.
+ *
+ * It is used as follows
+ *
+ * RemoteFolderTreeBuilder.buildRemoteTree(CVSRepositoryLocation, IManagedFolder, String, IProgressMonitor);
+ *
+ * The provider IManagedFolder can be a local resource or a RemoteFolderTree that
+ * that was previously built.
+ */
+public class RemoteFolderTreeBuilder {
+
+ private Map fileDeltas;
+ private List changedFiles;
+ private Map remoteFolderTable;
+
+ private ICVSFolder root;
+ private RemoteFolderTree remoteRoot;
+ private CVSRepositoryLocation repository;
+
+ private CVSTag tag;
+
+ private LocalOption[] updateLocalOptions;
+
+ private boolean projectDoesNotExist = false;
+
+ private static String UNKNOWN = ""; //$NON-NLS-1$
+ private static String DELETED = "DELETED"; //$NON-NLS-1$
+ private static String ADDED = "ADDED"; //$NON-NLS-1$
+ private static String FOLDER = "FOLDER"; //$NON-NLS-1$
+
+ private static Map EMPTY_MAP = new HashMap();
+
+ static class DeltaNode {
+ int syncState = Update.STATE_NONE;
+ String name;
+ String revision;
+
+ DeltaNode(String name, String revision, int syncState) {
+ this.name = name;
+ this.revision = revision;
+ this.syncState = syncState;
+ }
+
+ String getName() {
+ return name;
+ }
+
+ String getRevision() {
+ return revision;
+ }
+
+ int getSyncState() {
+ return syncState;
+ }
+ }
+
+
+ private RemoteFolderTreeBuilder(CVSRepositoryLocation repository, ICVSFolder root, CVSTag tag) {
+ this.repository = repository;
+ this.root = root;
+ this.tag = tag;
+ this.fileDeltas = new HashMap();
+ this.changedFiles = new ArrayList();
+ this.remoteFolderTable = new HashMap();
+
+ // Build the local options
+ List localOptions = new ArrayList();
+ localOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES);
+ if (tag != null) {
+ if (tag.getType() == CVSTag.HEAD) {
+ localOptions.add(Update.CLEAR_STICKY);
+ } else {
+ localOptions.add(Update.makeTagOption(tag));
+ }
+ }
+ updateLocalOptions = (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]);
+ }
+
+ private LocalOption[] getOptionsWithoutTag() {
+ // Build the local options
+ List localOptions = new ArrayList();
+ localOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES);
+ return (LocalOption[])localOptions.toArray(new LocalOption[localOptions.size()]);
+ }
+
+ public static RemoteFolderTree buildBaseTree(CVSRepositoryLocation repository, ICVSFolder root, CVSTag tag, IProgressMonitor monitor) throws CVSException {
+ RemoteFolderTreeBuilder builder = new RemoteFolderTreeBuilder(repository, root, tag);
+ return builder.buildBaseTree(null, root, monitor);
+ }
+
+ public static RemoteFolderTree buildRemoteTree(CVSRepositoryLocation repository, IContainer root, CVSTag tag, IProgressMonitor monitor) throws CVSException {
+ return buildRemoteTree(repository, CVSWorkspaceRoot.getCVSFolderFor(root), tag, monitor);
+ }
+
+ public static RemoteFolderTree buildRemoteTree(CVSRepositoryLocation repository, ICVSFolder root, CVSTag tag, IProgressMonitor monitor) throws CVSException {
+ RemoteFolderTreeBuilder builder = new RemoteFolderTreeBuilder(repository, root, tag);
+ return builder.buildTree(monitor);
+ }
+
+ private RemoteFolderTree buildTree(IProgressMonitor monitor) throws CVSException {
+ Session session = new Session(repository, root, false);
+ session.open(monitor);
+ try {
+ fetchDelta(session, monitor);
+ if (projectDoesNotExist) {
+ return null;
+ }
+ } finally {
+ session.close();
+ }
+ // FIXME: We need a second session because of the use of a different handle on the same remote resource
+ // We didn't need one before!!! Perhaps we could support the changing of a sessions root as long as
+ // the folder sync info is the same
+ remoteRoot =
+ new RemoteFolderTree(null, root.getName(), repository,
+ new Path(root.getFolderSyncInfo().getRepository()),
+ tagForRemoteFolder(root, tag));
+ session = new Session(repository, remoteRoot, false);
+ session.open(monitor);
+ try {
+ buildRemoteTree(session, root, remoteRoot, Path.EMPTY, monitor);
+ if (!changedFiles.isEmpty())
+ fetchFileRevisions(session, (String[])changedFiles.toArray(new String[changedFiles.size()]), monitor);
+ return remoteRoot;
+ } finally {
+ session.close();
+ }
+ }
+
+ /*
+ * Build the base remote tree from the local tree.
+ *
+ * The localPath is used to retrieve deltas from the recorded deltas
+ *
+ */
+ private RemoteFolderTree buildBaseTree(RemoteFolderTree parent, ICVSFolder local, IProgressMonitor monitor) throws CVSException {
+
+ // Create a remote folder tree corresponding to the local resource
+ RemoteFolderTree remote = new RemoteFolderTree(parent, local.getName(), repository, new Path(local.getFolderSyncInfo().getRepository()), local.getFolderSyncInfo().getTag());
+
+ // Create a List to contain the created children
+ List children = new ArrayList();
+
+ // Build the child folders corresponding to local folders base
+ ICVSFolder[] folders = local.getFolders();
+ for (int i=0;i<folders.length;i++) {
+ if (folders[i].isManaged() && folders[i].isCVSFolder()) {
+ children.add(buildBaseTree(remote, folders[i], monitor));
+ }
+ }
+
+ // Build the child files corresponding to local files base
+ ICVSFile[] files = local.getFiles();
+ for (int i=0;i<files.length;i++) {
+ ICVSFile file = files[i];
+ ResourceSyncInfo info = file.getSyncInfo();
+ // if there is no sync info then there is no base
+ if (info==null)
+ continue;
+ // There is no remote if the file was added
+ if (info.isAdded())
+ continue;
+ // If the file was deleted locally, we need to generate a new sync info without the delete flag
+ if (info.isDeleted())
+ info = new ResourceSyncInfo(info.getName(), info.getRevision(), info.getTimeStamp(), info.getKeywordMode(), info.getTag(), info.getPermissions());
+ children.add(new RemoteFile(remote, info));
+ }
+
+ // Add the children to the remote folder tree
+ remote.setChildren((ICVSRemoteResource[])children.toArray(new ICVSRemoteResource[children.size()]));
+
+ return remote;
+ }
+
+ /*
+ * Build the remote tree from the local tree and the recorded deltas.
+ *
+ * The localPath is used to retrieve deltas from the recorded deltas
+ *
+ */
+ private void buildRemoteTree(Session session, ICVSFolder local, RemoteFolderTree remote, IPath localPath, IProgressMonitor monitor) throws CVSException {
+
+ // Add the remote folder to the remote folder lookup table (used to update file revisions)
+ remoteFolderTable.put(remote.getFolderSyncInfo().getRemoteLocation(), remote);
+
+ // Create a map to contain the created children
+ Map children = new HashMap();
+
+ // If there's no corresponding local resource then we need to fetch its contents in order to populate the deltas
+ if (local == null) {
+ fetchNewDirectory(session, remote, localPath, monitor);
+ }
+
+ // Fetch the delta's for the folder
+ Map deltas = (Map)fileDeltas.get(localPath);
+ if (deltas == null)
+ deltas = EMPTY_MAP;
+
+ // If there is a local, use the local children to start buidling the remote children
+ if (local != null) {
+ // Build the child folders corresponding to local folders
+ ICVSFolder[] folders = local.getFolders();
+ for (int i=0;i<folders.length;i++) {
+ DeltaNode d = (DeltaNode)deltas.get(folders[i].getName());
+ if (folders[i].isCVSFolder() && ! isOrphanedSubtree(session, folders[i]) && (d==null || d.getRevision() != DELETED)) {
+ children.put(folders[i].getName(),
+ new RemoteFolderTree(remote, folders[i].getName(), repository,
+ new Path(folders[i].getFolderSyncInfo().getRepository()),
+ tagForRemoteFolder(folders[i],tag)));
+ }
+ }
+ // Build the child files corresponding to local files
+ ICVSFile[] files = local.getFiles();
+ for (int i=0;i<files.length;i++) {
+ ICVSFile file = files[i];
+
+ DeltaNode d = (DeltaNode)deltas.get(file.getName());
+ ResourceSyncInfo info = file.getSyncInfo();
+ // if there is no sync info then there isn't a remote file for this local file on the
+ // server.
+ if (info==null)
+ continue;
+ // There is no remote if the file was added and we didn't get a conflict (C) indicator from the server
+ if (info.isAdded() && d==null)
+ continue;
+ // There is no remote if the file was deleted and we didn;t get a remove (R) indicator from the server
+ if (info.isDeleted() && d==null)
+ continue;
+
+ int type = d==null ? Update.STATE_NONE : d.getSyncState();
+ children.put(file.getName(), new RemoteFile(remote, type, info));
+ }
+ }
+
+ // Build the children for new or out-of-date resources from the deltas
+ Iterator i = deltas.keySet().iterator();
+ while (i.hasNext()) {
+ String name = (String)i.next();
+ DeltaNode d = (DeltaNode)deltas.get(name);
+ String revision = d.getRevision();
+ if (revision == FOLDER) {
+ // XXX should getRemotePath() return an IPath instead of a String?
+ children.put(name, new RemoteFolderTree(remote, repository,
+ new Path(remote.getRepositoryRelativePath()).append(name),
+ tagForRemoteFolder(remote, tag)));
+ } else if (revision == ADDED) {
+ children.put(name, new RemoteFile(remote, d.getSyncState(), name, tagForRemoteFolder(remote, tag)));
+ } else if (revision == UNKNOWN) {
+ // The local resource is out of sync with the remote.
+ // Create a RemoteFile associated with the tag so we are assured of getting the proper revision
+ // (Note: this will replace the RemoteFile added from the local base)
+ children.put(name, new RemoteFile(remote, d.getSyncState(), name, tagForRemoteFolder(remote, tag)));
+ } else if (revision == DELETED) {
+ // This should have been deleted while creating from the local resources.
+ // If it wasn't, delete it now.
+ if (children.containsKey(name))
+ children.remove(name);
+ } else {
+ // We should never get here
+ }
+ }
+
+ // Add the children to the remote folder tree
+ remote.setChildren((ICVSRemoteResource[])children.values().toArray(new ICVSRemoteResource[children.size()]));
+
+ // We have to delay building the child folders to support the proper fetching of new directories
+ // due to the fact that the same CVS home directory (i.e. the same root directory) must
+ // be used for all requests sent over the same connection
+ Iterator childIterator = children.entrySet().iterator();
+ List emptyChildren = new ArrayList();
+ while (childIterator.hasNext()) {
+ Map.Entry entry = (Map.Entry)childIterator.next();
+ if (((RemoteResource)entry.getValue()).isFolder()) {
+ RemoteFolderTree remoteFolder = (RemoteFolderTree)entry.getValue();
+ String name = (String)entry.getKey();
+ ICVSFolder localFolder;
+ DeltaNode d = (DeltaNode)deltas.get(name);
+ // for directories that are new on the server
+ if (d!=null && d.getRevision() == FOLDER)
+ localFolder = null;
+ else
+ localFolder = local.getFolder(name);
+ buildRemoteTree(session, localFolder, remoteFolder, localPath.append(name), monitor);
+ // Record any children that are empty
+ if (pruneEmptyDirectories() && remoteFolder.getChildren().length == 0) {
+ // Prune if the local folder is also empty.
+ if (localFolder == null || (localFolder.getFiles().length == 0 && localFolder.getFolders().length == 0))
+ emptyChildren.add(remoteFolder);
+ else {
+ // Also prune if the tag we are fetching is not HEAD and differs from the tag of the local folder
+ FolderSyncInfo info = localFolder.getFolderSyncInfo();
+ if (tag != null && info != null && ! tag.equals(CVSTag.DEFAULT) && ! tag.equals(info.getTag()))
+ emptyChildren.add(remoteFolder);
+ }
+ }
+ }
+ }
+
+ // Prune any empty child folders
+ if (pruneEmptyDirectories() && !emptyChildren.isEmpty()) {
+ List newChildren = new ArrayList();
+ newChildren.addAll(Arrays.asList(remote.getChildren()));
+ newChildren.removeAll(emptyChildren);
+ remote.setChildren((ICVSRemoteResource[])newChildren.toArray(new ICVSRemoteResource[newChildren.size()]));
+
+ }
+ }
+
+ /*
+ * This method fetches the delta between the local state and the remote state of the resource tree
+ * and records the deltas in the fileDeltas instance variable
+ *
+ * Returns the list of changed files
+ */
+ private List fetchDelta(Session session, IProgressMonitor monitor) throws CVSException {
+
+ // Create an listener that will accumulate new and removed files and folders
+ final List newChildDirectories = new ArrayList();
+ IUpdateMessageListener listener = new IUpdateMessageListener() {
+ public void directoryInformation(IPath path, boolean newDirectory) {
+ if (newDirectory) {
+ // Record new directory with parent so it can be retrieved when building the parent
+ recordDelta(path, FOLDER, Update.STATE_NONE);
+ // Record new directory to be used as a parameter to fetch its contents
+ newChildDirectories.add(path.toString());
+ }
+ }
+ public void directoryDoesNotExist(IPath path) {
+ // Record removed directory with parent so it can be removed when building the parent
+ if (path.isEmpty()) {
+ projectDoesNotExist = true;
+ } else {
+ recordDelta(path, DELETED, Update.STATE_NONE);
+ }
+ }
+ public void fileInformation(int type, String filename) {
+ // Cases that do not require action are:
+ // case 'A' : = A locally added file that does not exists remotely
+ // case '?' : = A local file that has not been added and does not exists remotely
+ // case 'M' : = A locally modified file that has not been modified remotely
+ switch(type) {
+ case Update.STATE_MERGEABLE_CONFLICT :
+ case Update.STATE_CONFLICT :
+ // We have an remote change to a modified local file
+ // The change could be a local change conflicting with a remote deletion.
+ // If so, the deltas may already have a DELETED for the file.
+ // We shouldn't override this DELETED
+ IPath filePath = new Path(filename);
+ Map deltas = deltas = (Map)fileDeltas.get(filePath.removeLastSegments(1));
+ DeltaNode d = deltas != null ? (DeltaNode)deltas.get(filePath.lastSegment()) : null;
+ if ((d!=null) && (d.getRevision() == DELETED))
+ break;
+ case Update.STATE_DELETED : // We have a locally removed file that still exists remotely
+ case Update.STATE_REMOTE_CHANGES : // We have an remote change to an unmodified local file
+ changedFiles.add(filename);
+ recordDelta(new Path(filename), UNKNOWN, type);
+ break;
+ }
+ }
+ public void fileDoesNotExist(String filename) {
+ recordDelta(new Path(filename), DELETED, Update.STATE_NONE);
+ }
+ };
+
+ // Perform a "cvs -n update -d [-r tag] ." in order to get the
+ // messages from the server that will indicate what has changed on the
+ // server.
+ IStatus status = Command.UPDATE.execute(session,
+ new GlobalOption[] { Command.DO_NOT_CHANGE },
+ updateLocalOptions,
+ new String[] { Session.CURRENT_LOCAL_FOLDER },
+ new UpdateListener(listener),
+ monitor);
+ return changedFiles;
+ }
+
+ private void fetchNewDirectory(Session session, RemoteFolderTree newFolder, IPath localPath, IProgressMonitor monitor) throws CVSException {
+
+ // Create an listener that will accumulate new files and folders
+ IUpdateMessageListener listener = new IUpdateMessageListener() {
+ public void directoryInformation(IPath path, boolean newDirectory) {
+ if (newDirectory) {
+ // Record new directory with parent so it can be retrieved when building the parent
+ // NOTE: Check path prefix
+ recordDelta(path, FOLDER, Update.STATE_NONE);
+ }
+ }
+ public void directoryDoesNotExist(IPath path) {
+ }
+ public void fileInformation(int type, String filename) {
+ // NOTE: Check path prefix
+ changedFiles.add(filename);
+ recordDelta(new Path(filename), ADDED, type);
+ }
+ public void fileDoesNotExist(String filename) {
+ }
+ };
+
+ // NOTE: Should use the path relative to the remoteRoot
+ IPath path = new Path(newFolder.getRepositoryRelativePath());
+ IStatus status = Command.UPDATE.execute(session,
+ new GlobalOption[] { Command.DO_NOT_CHANGE },
+ updateLocalOptions,
+ new String[] { localPath.toString() },
+ new UpdateListener(listener),
+ monitor);
+ if (status.getCode() == CVSStatus.SERVER_ERROR) {
+ // FIXME: This should be refactored (maybe static methods on CVSException?)
+ CVSServerException e = new CVSServerException(status);
+ if ( ! e.isNoTagException() && e.containsErrors())
+ throw e;
+ // we now know that this is an exception caused by a cvs bug.
+ // if the folder has no files in it (just subfolders) cvs does not respond with the subfolders...
+ // workaround: retry the request with no tag to get the directory names (if any)
+ Policy.checkCanceled(monitor);
+ status = Command.UPDATE.execute(session,
+ new GlobalOption[] { Command.DO_NOT_CHANGE },
+ getOptionsWithoutTag(),
+ new String[] { localPath.toString() },
+ new UpdateListener(listener),
+ monitor);
+ if (status.getCode() == CVSStatus.SERVER_ERROR) {
+ throw new CVSServerException(status);
+ }
+ }
+ }
+
+ // Get the file revisions for the given filenames
+ private void fetchFileRevisions(Session session, String[] fileNames, IProgressMonitor monitor) throws CVSException {
+
+ // Create a listener for receiving the revision info
+ final int[] count = new int[] {0};
+ final Map revisions = new HashMap();
+ IStatusListener listener = new IStatusListener() {
+ public void fileStatus(IPath path, String remoteRevision) {
+ try {
+ updateRevision(path, remoteRevision);
+ count[0]++;
+ } catch (CVSException e) {
+ // The count will be off which will trigger another exception
+ CVSProviderPlugin.log(e);
+ }
+ }
+ };
+
+ // Perform a "cvs status..." with a custom message handler
+ IStatus status = Command.STATUS.execute(session,
+ Command.NO_GLOBAL_OPTIONS,
+ Command.NO_LOCAL_OPTIONS,
+ fileNames,
+ new StatusListener(listener),
+ monitor);
+ if (status.getCode() == CVSStatus.SERVER_ERROR) {
+ throw new CVSServerException(status);
+ }
+
+ // XXX we can't make this check because it may be valid to call this method
+ // without any file names (e.g. fileNames array empty) which would run the
+ // status on all files.
+ //if (count[0] != fileNames.length)
+ // throw new CVSException(Policy.bind("RemoteFolder.errorFetchingRevisions"));
+ }
+
+ private boolean pruneEmptyDirectories() {
+ return CVSProviderPlugin.getPlugin().getPruneEmptyDirectories();
+ }
+ /*
+ * Record the deltas in a double map where the outer key is the parent directory
+ * and the inner key is the file name. The value is the revision of the file or
+ * DELETED (file or folder). New folders have a revision of FOLDER.
+ *
+ * A revison of UNKNOWN indicates that the revision has not been fetched
+ * from the repository yet.
+ */
+ private void recordDelta(IPath path, String revision, int syncState) {
+ IPath parent = path.removeLastSegments(1);
+ Map deltas = (Map)fileDeltas.get(parent);
+ if (deltas == null) {
+ deltas = new HashMap();
+ fileDeltas.put(parent, deltas);
+ }
+ String name = path.lastSegment();
+ deltas.put(name, new DeltaNode(name, revision, syncState));
+ }
+
+ private void updateRevision(IPath path, String revision) throws CVSException {
+ RemoteFolderTree folder = (RemoteFolderTree)remoteFolderTable.get(path.removeLastSegments(1).toString());
+ ((RemoteFile)folder.getFile(path.lastSegment())).setRevision(revision);
+ }
+
+ /*
+ * Return the tag that should be associated with a remote folder.
+ *
+ * This method is used to ensure that new directories contain the tag
+ * derived from the parant local folder when appropriate. For instance,
+ *
+ * The tag should be the provided tag. However, if tag is null, the
+ * tag for the folder should be derived from the provided reference folder
+ * which could be the local resource corresponding to the remote or the parent
+ * of the remote.
+ */
+ private CVSTag tagForRemoteFolder(ICVSFolder folder, CVSTag tag) throws CVSException {
+ return tag == null ? folder.getFolderSyncInfo().getTag() : tag;
+ }
+
+ private boolean isOrphanedSubtree(Session session, ICVSFolder mFolder) {
+ return mFolder.isCVSFolder() && ! mFolder.isManaged() && ! mFolder.equals(session.getLocalRoot()) && mFolder.getParent().isCVSFolder();
+ }
+}
+
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
index ac14521cb..7118cde0a 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteModule.java
@@ -17,6 +17,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
@@ -41,7 +42,7 @@ public class RemoteModule extends RemoteFolder {
public static RemoteModule[] getRemoteModules(ICVSRepositoryLocation repository, CVSTag tag, IProgressMonitor monitor) throws TeamException {
RemoteModule[] modules;
- Session s = new Session(repository, (ICVSFolder)Session.getManagedResource(ResourcesPlugin.getWorkspace().getRoot()), false);
+ Session s = new Session(repository, (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(ResourcesPlugin.getWorkspace().getRoot()), false);
s.open(monitor);
try {
modules = Command.CHECKOUT.getRemoteModules(s, tag, monitor);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java
index 0b817fa0f..3696c9d28 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/RemoteResource.java
@@ -7,12 +7,14 @@ package org.eclipse.team.internal.ccvs.core.resources;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.Update;
-import org.eclipse.team.internal.ccvs.core.syncinfo.*;
+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.Util;
@@ -149,4 +151,17 @@ public abstract class RemoteResource extends PlatformObject implements ICVSRemot
// ensure that clients are not trying to set sync info on remote handles.
Assert.isTrue(false);
}
+ /*
+ * @see ICVSResource#reloadSyncInfo(IProgressMonitor)
+ */
+ public void reloadSyncInfo(IProgressMonitor monitor) throws CVSException {
+ // NO-OP
+ }
+
+ /*
+ * @see ICVSResource#saveSyncInfo(IProgressMonitor)
+ */
+ public void saveSyncInfo(IProgressMonitor monitor) throws CVSException {
+ // NO-OP
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java
index defe46701..a23245581 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java
@@ -19,17 +19,15 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.team.ccvs.core.CVSProviderPlugin;
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.resources.ICVSSynchronizer;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
import org.eclipse.team.internal.ccvs.core.util.Assert;
import org.eclipse.team.internal.ccvs.core.util.FileNameMatcher;
import org.eclipse.team.internal.ccvs.core.util.FileUtil;
import org.eclipse.team.internal.ccvs.core.util.ResourceDeltaVisitor;
import org.eclipse.team.internal.ccvs.core.util.SyncFileUtil;
-import org.eclipse.team.internal.ccvs.core.Policy;
/**
* The FileSystemSynchronizer stores sync information to be compatible with CVS command line
@@ -244,7 +242,6 @@ public class FileSystemSynchronizer implements ICVSSynchronizer {
*/
public FolderSyncInfo getFolderSync(File file) throws CVSException {
if(file.exists() && file.isDirectory()) {
- LocalFolder folder = new LocalFolder(file);
if(SyncFileUtil.getCVSSubdirectory(file).exists()) {
CacheData data = (CacheData)folderSyncCache.get(file, null);
if(data!=null) {
@@ -261,12 +258,9 @@ public class FileSystemSynchronizer implements ICVSSynchronizer {
public ResourceSyncInfo getResourceSync(File file) throws CVSException {
File parentFile = file.getParentFile();
if (parentFile != null) {
- LocalFolder parent = new LocalFolder(parentFile);
- if(parent.exists() && parent.isCVSFolder()) {
- CacheData data = (CacheData)resourceSyncCache.get(file, null);
- if(data!=null) {
- return (ResourceSyncInfo)data.getData();
- }
+ CacheData data = (CacheData)resourceSyncCache.get(file, null);
+ if(data!=null) {
+ return (ResourceSyncInfo)data.getData();
}
}
return null;
@@ -277,12 +271,7 @@ public class FileSystemSynchronizer implements ICVSSynchronizer {
*/
public void setFolderSync(File file, FolderSyncInfo info) throws CVSException {
SyncFileUtil.writeFolderConfig(file, info);
- folderSyncCache.put(new CacheData(file, info, CACHE_EXPIRATION_MINUTES));
-
- // the server won't add directories as sync info, therefore it must be done when
- // a directory is shared with the repository.
- setResourceSync(file, new ResourceSyncInfo(file.getName()));
-
+ folderSyncCache.put(new CacheData(file, info, CACHE_EXPIRATION_MINUTES));
}
/*
@@ -292,14 +281,7 @@ public class FileSystemSynchronizer implements ICVSSynchronizer {
Assert.isNotNull(info);
Assert.isTrue(file.getName().equals(info.getName()));
- try {
- LocalFolder parent = new LocalFolder(file.getParentFile());
- if(parent.exists() && parent.isCVSFolder()) {
- SyncFileUtil.writeResourceSync(file, info);
- }
- } catch(CVSException e) {
- // XXX Bad eating of exception
- }
+ SyncFileUtil.writeResourceSync(file, info);
resourceSyncCache.put(new CacheData(file, info, CACHE_EXPIRATION_MINUTES));
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/OrphanedFolderListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/OrphanedFolderListener.java
index 0675ae320..4c0ce1747 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/OrphanedFolderListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/OrphanedFolderListener.java
@@ -7,11 +7,13 @@ package org.eclipse.team.internal.ccvs.core.util;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.Session;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
/**
* Listen for the addition of orphaned subtrees as a result of a copy or move.
@@ -24,7 +26,7 @@ public class OrphanedFolderListener extends ResourceDeltaVisitor {
private void handleOrphanedSubtree(IResource resource) {
if (resource.getType() == IResource.FOLDER) {
try {
- ICVSFolder mFolder = (ICVSFolder)Session.getManagedResource(resource);
+ ICVSFolder mFolder = (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(resource);
if (mFolder.isCVSFolder() && ! mFolder.isManaged() && mFolder.getParent().isCVSFolder()) {
mFolder.unmanage();
CVSProviderPlugin.getSynchronizer().reload(resource.getLocation().toFile(), Policy.monitorFor(null));
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java
index 0be5cea3f..bf9ce02ab 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java
@@ -9,11 +9,12 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Session;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
import org.eclipse.team.internal.ccvs.core.Policy;
/**
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java
index c593e864a..a13bfab1d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java
@@ -22,18 +22,15 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.ccvs.core.ICVSFile;
import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.ITeamProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.CVSLocalSyncElement;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
-import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
-import org.eclipse.team.internal.ccvs.core.syncinfo.*;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
/**
@@ -304,23 +301,16 @@ public class CVSCompareEditorInput extends CompareEditorInput {
} else if (left instanceof ResourceNode) {
IResource resource = ((ResourceNode)left).getResource();
try {
- ICVSResource element = null;
- if(resource.getType()==IResource.FILE) {
- element = new LocalFile(resource.getLocation().toFile());
- if (((LocalFile)element).isDirty()) {
- return NODE_NOT_EQUAL;
- }
- } else {
- element = new LocalFolder(resource.getLocation().toFile());
+ ICVSResource element = CVSWorkspaceRoot.getCVSResourceFor(resource);
+ if (resource.getType() == IResource.FILE) {
+ if (((ICVSFile) element).isDirty()) return NODE_NOT_EQUAL;
}
if(cvsProvider==null) {
return NODE_UNKNOWN;
}
- leftEdition = cvsProvider.getRemoteResource(resource);
+ leftEdition = CVSWorkspaceRoot.getRemoteResourceFor(resource);
} catch(CVSException e) {
return NODE_UNKNOWN;
- } catch(TeamException e) {
- return NODE_UNKNOWN;
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
index bb2b2c0ea..a5a3c6275 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
@@ -57,6 +57,7 @@ import org.eclipse.team.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.ccvs.core.ILogEntry;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
public class CVSCompareRevisionsInput extends CompareEditorInput {
@@ -86,7 +87,7 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
if (revisionName != null) {
IResource resource = CVSCompareRevisionsInput.this.resource;
try {
- ICVSRemoteFile currentEdition = (ICVSRemoteFile)provider.getRemoteResource(resource);
+ ICVSRemoteFile currentEdition = (ICVSRemoteFile) CVSWorkspaceRoot.getRemoteResourceFor(resource);
if (currentEdition != null && currentEdition.getRevision().equals(revisionName)) {
return "*" + revisionName;
} else {
@@ -392,7 +393,7 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
}
private void updateCurrentEdition() {
try {
- this.currentEdition = ((ICVSRemoteFile)provider.getRemoteResource(resource));
+ this.currentEdition = ((ICVSRemoteFile) CVSWorkspaceRoot.getRemoteResourceFor(resource));
} catch (TeamException e) {
handle(e);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
index e930eea39..acbbe3ea3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
@@ -10,6 +10,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;
@@ -22,16 +24,14 @@ import org.eclipse.swt.graphics.ImageData;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.ITeamProvider;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
-import org.eclipse.team.internal.ccvs.core.syncinfo.*;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.ui.ISharedImages;
@@ -146,7 +146,7 @@ public class CVSDecorationRunnable implements Runnable {
switch (type) {
case IResource.FOLDER :
case IResource.PROJECT :
- ICVSFolder folder = new LocalFolder(resourceLocation.toFile());
+ ICVSFolder folder = CVSWorkspaceRoot.getCVSFolderFor((IContainer) resource);
FolderSyncInfo folderInfo = folder.getFolderSyncInfo();
if (folderInfo != null) {
CVSTag tag = folderInfo.getTag();
@@ -163,7 +163,7 @@ public class CVSDecorationRunnable implements Runnable {
break;
case IResource.FILE :
format = store.getString(ICVSUIConstants.PREF_FILETEXT_DECORATION);
- ICVSFile file = new LocalFile(resourceLocation.toFile());
+ ICVSFile file = CVSWorkspaceRoot.getCVSFileFor((IFile) resource);
ResourceSyncInfo fileInfo = file.getSyncInfo();
if (fileInfo != null) {
CVSTag tag = fileInfo.getTag();
@@ -200,7 +200,7 @@ public class CVSDecorationRunnable implements Runnable {
try {
IPath location = resource.getLocation();
if(location!=null) {
- ICVSFile cvsFile = new LocalFile(location.toFile());
+ ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile) resource);
ResourceSyncInfo info = cvsFile.getSyncInfo();
// show merged icon if file has been merged but has not been edited (e.g. on commit it will be ignored)
if(info!=null && info.isNeedsMerge(cvsFile.getTimeStamp())) {
@@ -249,12 +249,7 @@ public class CVSDecorationRunnable implements Runnable {
return false;
}
- ICVSResource cvsResource;
- if (resource.getType() == IResource.FILE) {
- cvsResource = new LocalFile(resource.getLocation().toFile());
- } else {
- cvsResource = new LocalFolder(resource.getLocation().toFile());
- }
+ ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
try {
if (!cvsResource.isManaged()) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java
index c08f9677b..300dc96d9 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java
@@ -14,9 +14,9 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.team.ccvs.core.CVSTag;
+import org.eclipse.team.ccvs.core.ICVSFile;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
-import org.eclipse.team.internal.ccvs.core.syncinfo.*;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.ui.dialogs.PropertyPage;
@@ -36,7 +36,7 @@ public class CVSFilePropertiesPage extends PropertyPage {
composite.setLayout(layout);
try {
- LocalFile cvsResource = new LocalFile(file.getLocation().toFile());
+ ICVSFile cvsResource = CVSWorkspaceRoot.getCVSFileFor(file);
if (!cvsResource.isManaged()) {
if (cvsResource.isIgnored()) {
createLabel(composite, Policy.bind("CVSFilePropertiesPage.ignored"));
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java
index 2c935d78e..d827f5cff 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPropertiesPage.java
@@ -23,7 +23,6 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
@@ -35,6 +34,7 @@ import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.ccvs.core.IUserInfo;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.ui.dialogs.PropertyPage;
public class CVSPropertiesPage extends PropertyPage {
@@ -166,12 +166,13 @@ public class CVSPropertiesPage extends PropertyPage {
provider = (CVSTeamProvider)TeamPlugin.getManager().getProvider(project);
if (provider == null) return;
+ CVSWorkspaceRoot cvsRoot = provider.getCVSWorkspaceRoot();
String[] methods = CVSProviderPlugin.getProvider().getSupportedConnectionMethods();
for (int i = 0; i < methods.length; i++) {
methodType.add(methods[i]);
}
try {
- String method = provider.getConnectionMethod(project);
+ String method = cvsRoot.getRemoteLocation().getMethod().getName();
methodType.select(methodType.indexOf(method));
info = provider.getUserInfo(project);
@@ -182,7 +183,7 @@ public class CVSPropertiesPage extends PropertyPage {
passwordText.setText("*********");
try {
- ICVSRemoteResource resource = provider.getRemoteResource(project);
+ ICVSRemoteResource resource = cvsRoot.getRemoteResourceFor(project);
ICVSRepositoryLocation location = resource.getRepository();
hostLabel.setText(location.getHost());
int port = location.getPort();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSResourceNode.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSResourceNode.java
index 0e7358b5e..9d5cd8640 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSResourceNode.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSResourceNode.java
@@ -13,10 +13,10 @@ import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
/**
* This class is a wrapper for a CVSResource. We use it instead of the standard
@@ -36,7 +36,8 @@ public class CVSResourceNode extends ResourceNode {
IResource resource = getResource();
if (resource instanceof IContainer) {
try {
- ICVSFile[] files = new LocalFolder(resource.getLocation().toFile()).getFiles();
+ ICVSFolder cvsFolder = CVSWorkspaceRoot.getCVSFolderFor((IContainer) resource);
+ ICVSFile[] files = cvsFolder.getFiles();
for (int i= 0; i < files.length; i++) {
IResource child = getFile((IContainer)resource, files[i].getName());
if (child.exists()) {
@@ -46,7 +47,7 @@ public class CVSResourceNode extends ResourceNode {
}
}
}
- ICVSFolder[] folders = new LocalFolder(resource.getLocation().toFile()).getFolders();
+ ICVSFolder[] folders = cvsFolder.getFolders();
for (int i= 0; i < folders.length; i++) {
IResource child = getFolder((IContainer)resource, folders[i].getName());
if (child.exists()) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index ab57f7f73..5a90bf177 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -20,14 +20,15 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSRemoteFile;
import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.ui.model.CVSAdapterFactory;
import org.eclipse.team.ui.TeamUIPlugin;
import org.eclipse.ui.IWorkbenchPage;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
index 89c32c255..2de8a44d1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
@@ -64,6 +64,7 @@ import org.eclipse.team.ccvs.core.ILogEntry;
import org.eclipse.team.core.ITeamProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.actions.OpenLogEntryAction;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.ISelectionListener;
@@ -117,7 +118,7 @@ public class HistoryView extends ViewPart implements ISelectionListener {
String revision = entry.getRevision();
if (file == null) return revision;
try {
- ICVSRemoteFile currentEdition = (ICVSRemoteFile)provider.getRemoteResource(file);
+ ICVSRemoteFile currentEdition = (ICVSRemoteFile) CVSWorkspaceRoot.getRemoteResourceFor(file);
if (currentEdition != null && currentEdition.getRevision().equals(revision)) {
return "*" + revision;
}
@@ -631,7 +632,7 @@ public class HistoryView extends ViewPart implements ISelectionListener {
if (teamProvider != null && teamProvider instanceof CVSTeamProvider) {
this.provider = (CVSTeamProvider)teamProvider;
try {
- tableViewer.setInput(provider.getRemoteResource(file));
+ tableViewer.setInput(CVSWorkspaceRoot.getRemoteResourceFor(file));
} catch (TeamException e) {
ErrorDialog.openError(getViewSite().getShell(), null, null, e.getStatus());
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java
index 95a226363..ff18370d0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/TagSelectionDialog.java
@@ -55,7 +55,7 @@ import org.eclipse.team.internal.ccvs.ui.merge.TagElement;
import org.eclipse.team.internal.ccvs.ui.model.BranchTag;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
/**
* Dialog to prompt the user to choose a tag for a selected resource
@@ -208,7 +208,7 @@ public class TagSelectionDialog extends Dialog {
// initialize the table contents
try {
CVSTeamProvider provider = (CVSTeamProvider)TeamPlugin.getManager().getProvider(resource);
- tagTree.setInput(new ProjectElement((ICVSRemoteFolder)provider.getRemoteResource(resource)));
+ tagTree.setInput(new ProjectElement((ICVSRemoteFolder)CVSWorkspaceRoot.getRemoteResourceFor(resource)));
} catch (TeamException e) {
// To do: error dialog
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
index c1d7aa1c2..7f013cc81 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
@@ -16,14 +16,13 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.ITeamProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
-import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
-import org.eclipse.team.internal.ccvs.core.syncinfo.*;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.ui.CVSCompareEditorInput;
@@ -50,17 +49,10 @@ public class CompareWithRemoteAction extends TeamAction {
CVSTeamProvider provider = (CVSTeamProvider)TeamPlugin.getManager().getProvider(resources[0].getProject());
- LocalResource cvsResource = null;
- if (resources[0].getType()==IResource.FILE) {
- cvsResource = new LocalFile(resource.getLocation().toFile());
- } else {
- cvsResource = new LocalFolder(resource.getLocation().toFile());
- }
-
-
+ ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
CVSTag tag = null;
if (cvsResource.isFolder()) {
- FolderSyncInfo folderInfo = ((LocalFolder)cvsResource).getFolderSyncInfo();
+ FolderSyncInfo folderInfo = ((ICVSFolder)cvsResource).getFolderSyncInfo();
if (folderInfo!=null) {
tag = folderInfo.getTag();
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
index 1b997b583..efd8f4d7a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRevisionAction.java
@@ -6,28 +6,22 @@ package org.eclipse.team.internal.ccvs.ui.actions;
*/
import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Iterator;
import org.eclipse.compare.CompareUI;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
import org.eclipse.team.ccvs.core.ICVSRemoteFile;
import org.eclipse.team.ccvs.core.ILogEntry;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSCompareRevisionsInput;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.HistoryView;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.ui.actions.TeamAction;
@@ -42,7 +36,7 @@ public class CompareWithRevisionAction extends TeamAction {
IFile file = (IFile)resources[0];
CVSTeamProvider provider = (CVSTeamProvider)TeamPlugin.getManager().getProvider(file.getProject());
try {
- return (ICVSRemoteFile)provider.getRemoteResource(file);
+ return (ICVSRemoteFile)CVSWorkspaceRoot.getRemoteResourceFor(file);
} catch (TeamException e) {
handle(e, null, null);
return null;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
index 3a5fbb5bb..1b312a01b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
@@ -6,21 +6,18 @@ package org.eclipse.team.internal.ccvs.ui.actions;
*/
import java.lang.reflect.InvocationTargetException;
+
import org.eclipse.compare.CompareUI;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
import org.eclipse.team.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
-import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
import org.eclipse.team.internal.ccvs.ui.CVSCompareEditorInput;
import org.eclipse.team.internal.ccvs.ui.CVSResourceNode;
import org.eclipse.team.internal.ccvs.ui.Policy;
@@ -46,13 +43,6 @@ public class CompareWithTagAction extends TeamAction {
IResource resource = resources[0];
CVSTeamProvider provider = (CVSTeamProvider)TeamPlugin.getManager().getProvider(resource.getProject());
- LocalResource cvsResource = null;
- if (resources[0].getType()==IResource.FILE) {
- cvsResource = new LocalFile(resource.getLocation().toFile());
- } else {
- cvsResource = new LocalFolder(resource.getLocation().toFile());
- }
-
TagSelectionDialog dialog = new TagSelectionDialog(getShell(), resource);
dialog.setBlockOnOpen(true);
int result = dialog.open();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java
index cc9899c34..04921bedf 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java
@@ -11,11 +11,10 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.ui.actions.TeamAction;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
@@ -26,17 +25,8 @@ public class IgnoreAction extends TeamAction {
if (resources.length == 0) return false;
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
- ICVSResource cvsResource = null;
- switch (resource.getType()) {
- case IResource.FILE:
- cvsResource = new LocalFile(resource.getLocation().toFile());
- break;
- case IResource.FOLDER:
- cvsResource = new LocalFolder(resource.getLocation().toFile());
- break;
- default:
- return false;
- }
+ if (resource.getType() == IResource.PROJECT) return false;
+ ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
if (cvsResource.isManaged()) return false;
if (cvsResource.isIgnored()) return false;
}
@@ -48,21 +38,11 @@ public class IgnoreAction extends TeamAction {
IResource[] resources = getSelectedResources();
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
- ICVSResource cvsResource = null;
- switch (resource.getType()) {
- case IResource.FILE:
- cvsResource = new LocalFile(resource.getLocation().toFile());
- break;
- case IResource.FOLDER:
- cvsResource = new LocalFolder(resource.getLocation().toFile());
- break;
- }
- if (cvsResource != null) {
- try {
- cvsResource.setIgnored();
- } catch (CVSException e) {
- ErrorDialog.openError(getShell(), null, null, e.getStatus());
- }
+ ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
+ try {
+ cvsResource.setIgnored();
+ } catch (CVSException e) {
+ ErrorDialog.openError(getShell(), null, null, e.getStatus());
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RemoveRootAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RemoveRootAction.java
index aa2b7b8c4..0bb9cdcc4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RemoveRootAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/RemoveRootAction.java
@@ -86,7 +86,7 @@ public class RemoveRootAction extends TeamAction {
ITeamProvider teamProvider = manager.getProvider(projects[j]);
if (teamProvider instanceof CVSTeamProvider) {
CVSTeamProvider cvsProvider = (CVSTeamProvider)teamProvider;
- if (cvsProvider.getRemoteRoot().equals(roots[i])) {
+ if (cvsProvider.getCVSWorkspaceRoot().getRemoteLocation().equals(roots[i])) {
shared = true;
break;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithAction.java
index b7246e93a..4bffd3456 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithAction.java
@@ -12,14 +12,12 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.ui.actions.TeamAction;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.ui.actions.TeamAction;
public abstract class ReplaceWithAction extends TeamAction {
private boolean confirmOverwrite = true;
@@ -43,13 +41,7 @@ public abstract class ReplaceWithAction extends TeamAction {
return false;
}
- ICVSResource cvsResource;
- if (resource.getType() == IResource.FILE) {
- cvsResource = new LocalFile(resource.getLocation().toFile());
- } else {
- cvsResource = new LocalFolder(resource.getLocation().toFile());
- }
-
+ ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
try {
if (!cvsResource.isManaged()) {
if (cvsResource.isIgnored()) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java
index a078d7c08..12223485e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java
@@ -12,6 +12,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -30,11 +31,12 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.core.ITeamManager;
import org.eclipse.team.core.ITeamProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSDecorator;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.ui.actions.TeamAction;
@@ -144,10 +146,10 @@ public class UnmanageAction extends TeamAction {
IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
for (int i = 0; i < providerResources.length; i++) {
IResource resource = providerResources[i];
- LocalFolder folder = new LocalFolder(resource.getLocation().toFile());
+ ICVSFolder folder = CVSWorkspaceRoot.getCVSFolderFor((IContainer) resource);
if(deleteContent) {
folder.unmanage();
- CVSProviderPlugin.getSynchronizer().reload(folder.getLocalFile(), Policy.subMonitorFor(subMonitor, 90));
+ folder.reloadSyncInfo(Policy.subMonitorFor(subMonitor, 90));
}
TeamPlugin.getManager().removeProvider((IProject)resource, Policy.subMonitorFor(subMonitor, 10));
CVSDecorator.refresh(resource);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardEndPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardEndPage.java
index 35a1f88f2..5ad9567f2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardEndPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardEndPage.java
@@ -6,10 +6,7 @@ package org.eclipse.team.internal.ccvs.ui.merge;
*/
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -24,12 +21,9 @@ import org.eclipse.team.ccvs.core.CVSTeamProvider;
import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.model.BranchTag;
import org.eclipse.team.internal.ccvs.ui.wizards.CVSWizardPage;
-import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@@ -92,7 +86,7 @@ public class MergeWizardEndPage extends CVSWizardPage {
this.project = project;
try {
this.provider = ((CVSTeamProvider)TeamPlugin.getManager().getProvider(project));
- this.remote = (ICVSRemoteFolder)provider.getRemoteResource(project);
+ this.remote = (ICVSRemoteFolder) CVSWorkspaceRoot.getRemoteResourceFor(project);
} catch (TeamException e) {
// To do
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java
index 3bfe9f17d..44703f659 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizardStartPage.java
@@ -6,7 +6,6 @@ package org.eclipse.team.internal.ccvs.ui.merge;
*/
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -25,14 +24,12 @@ import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
-import org.eclipse.team.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.core.ITeamProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.model.RemoteModule;
-import org.eclipse.team.internal.ccvs.ui.wizards.*;
+import org.eclipse.team.internal.ccvs.ui.wizards.CVSWizardPage;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@@ -101,7 +98,7 @@ public class MergeWizardStartPage extends CVSWizardPage {
ITeamProvider provider = TeamPlugin.getManager().getProvider(project);
if (!(provider instanceof CVSTeamProvider)) return;
try {
- ICVSRemoteFolder remoteResource = (ICVSRemoteFolder)((CVSTeamProvider)provider).getRemoteResource(project);
+ ICVSRemoteFolder remoteResource = (ICVSRemoteFolder) CVSWorkspaceRoot.getRemoteResourceFor(project);
table.setInput(new VersionsElement(remoteResource));
} catch (TeamException e) {
// To do
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
index 874c97f0e..84f98ec5b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
@@ -24,12 +24,13 @@ import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.ccvs.core.ICVSFile;
import org.eclipse.team.ccvs.core.ICVSRemoteFile;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.sync.IRemoteResource;
import org.eclipse.team.core.sync.IRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.ui.CVSDecorator;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
@@ -144,7 +145,8 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
IResource resource = node.getResource();
if (resource.getType() == IResource.FILE) {
try {
- if (new LocalFile(((IFile)resource).getLocation().toFile()).getSyncInfo() == null) {
+ ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile) resource);
+ if (cvsFile.getSyncInfo() == null) {
DiffImage diffImage = new DiffImage(image, questionableDescriptor);
return diffImage.createImage();
}
@@ -164,7 +166,8 @@ public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
IResource resource = node.getResource();
if (resource.exists() && resource.getType() == IResource.FILE) {
try {
- ResourceSyncInfo info = new LocalFile(((IFile)resource).getLocation().toFile()).getSyncInfo();
+ ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile) resource);
+ ResourceSyncInfo info = cvsFile.getSyncInfo();
String kw;
if (info!=null) {
kw = CVSDecorator.getFileTypeString(resource.getName(), info.getKeywordMode());
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java
index 033ac5b86..26424b088 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/IgnoreAction.java
@@ -7,19 +7,18 @@ package org.eclipse.team.internal.ccvs.ui.sync;
import org.eclipse.compare.structuremergeviewer.IDiffContainer;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.sync.IRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
-import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.ui.sync.ChangedTeamContainer;
import org.eclipse.team.ui.sync.ITeamNode;
import org.eclipse.team.ui.sync.SyncSet;
@@ -45,10 +44,10 @@ public class IgnoreAction extends Action {
ICVSResource cvsResource = null;
if (first instanceof TeamFile) {
IResource resource = ((TeamFile)first).getMergeResource().getResource();
- cvsResource = new LocalFile(resource.getLocation().toFile());
+ cvsResource = CVSWorkspaceRoot.getCVSFileFor((IFile) resource);
} else if (first instanceof ChangedTeamContainer) {
IResource resource = ((ChangedTeamContainer)first).getMergeResource().getResource();
- cvsResource = new LocalFolder(resource.getLocation().toFile());
+ cvsResource = CVSWorkspaceRoot.getCVSFolderFor((IContainer) resource);
}
if (cvsResource != null) {
try {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
index 98085f88c..d016de05b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/BranchWizard.java
@@ -29,6 +29,7 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
@@ -74,13 +75,13 @@ public class BranchWizard extends Wizard {
CVSTeamProvider provider = (CVSTeamProvider)iterator.next();
List list = (List)table.get(provider);
IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
- ICVSRepositoryLocation root = provider.getRemoteRoot();
+ ICVSRepositoryLocation root = provider.getCVSWorkspaceRoot().getRemoteLocation();
CVSTag tag = new CVSTag(tagString, CVSTag.BRANCH);
try {
if (versionTag != null) {
provider.tag(providerResources, IResource.DEPTH_INFINITE, versionTag, subMonitor);
for (int i = 0; i < providerResources.length; i++) {
- ICVSRemoteFolder remoteResource = (ICVSRemoteFolder)provider.getRemoteResource(providerResources[i]);
+ ICVSRemoteFolder remoteResource = (ICVSRemoteFolder) CVSWorkspaceRoot.getRemoteResourceFor(providerResources[i]);
manager.addVersionTags(remoteResource, new CVSTag[] { versionTag });
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardAutoconnectPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardAutoconnectPage.java
index c082f21d3..c8f6295fe 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardAutoconnectPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardAutoconnectPage.java
@@ -17,13 +17,15 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSTag;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.ui.Policy;
@@ -104,7 +106,7 @@ public class ConfigurationWizardAutoconnectPage extends CVSWizardPage {
}
public void setProject(IProject project) {
try {
- ICVSFolder folder = (ICVSFolder)Session.getManagedResource(project);
+ ICVSFolder folder = (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(project);
info = folder.getFolderSyncInfo();
if (info == null) {
// This should never happen
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
index 29dd1eab9..5927f70fd 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
@@ -19,8 +19,10 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSTag;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.core.TeamException;
@@ -28,7 +30,7 @@ import org.eclipse.team.core.sync.IRemoteResource;
import org.eclipse.team.internal.ccvs.core.CVSProvider;
import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.*;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.ui.CVSDecorator;
@@ -296,7 +298,7 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
// Determine if there is an existing CVS/ directory from which configuration
// information can be retrieved.
try {
- ICVSFolder folder = (ICVSFolder)Session.getManagedResource(project);
+ ICVSFolder folder = (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(project);
FolderSyncInfo info = folder.getFolderSyncInfo();
return info != null;
} catch (TeamException e) {
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
index b891115e5..df12f4293 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
@@ -27,11 +27,14 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.tests.harness.EclipseWorkspaceTest;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSStatus;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.team.internal.ccvs.core.CVSException;
@@ -43,9 +46,8 @@ import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
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.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
index 725d7c106..540547037 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
@@ -21,9 +21,12 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
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.CVSStatus;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Session;
@@ -31,8 +34,7 @@ import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
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.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
import org.eclipse.team.internal.ccvs.core.util.FileUtil;
import org.eclipse.team.internal.ccvs.core.util.Util;
@@ -107,7 +109,7 @@ public abstract class JUnitTestCase extends TestCase {
locals.add(new CustomLocalOption(localOptions[i], null));
}
}
- Session s = new Session(getRepository(globalOptions, Session.getManagedFolder(root)), Session.getManagedFolder(root));
+ Session s = new Session(getRepository(globalOptions, CVSWorkspaceRoot.getCVSFolderFor(root)), CVSWorkspaceRoot.getCVSFolderFor(root));
s.open(monitor);
try {
IStatus status = ((Command)commandPool.get(request)).execute(s,
@@ -189,7 +191,7 @@ public abstract class JUnitTestCase extends TestCase {
*/
protected static ICVSFolder getManagedFolder(String relativePath) {
try {
- return Session.getManagedFolder(getFile(relativePath));
+ return CVSWorkspaceRoot.getCVSFolderFor(getFile(relativePath));
} catch (CVSException e) {
fail(e.getMessage());
return null;
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ReferenceClient.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ReferenceClient.java
index 8447ab552..d3268bf4d 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ReferenceClient.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ReferenceClient.java
@@ -10,9 +10,11 @@ import java.io.InputStreamReader;
import java.io.PrintStream;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Session;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.util.SyncFileUtil;
/**
@@ -69,7 +71,7 @@ public class ReferenceClient {
String commandLine;
globalOptions = (String[]) globalOptions.clone();
- mRoot = Session.getManagedFolder(ioRoot);
+ mRoot = CVSWorkspaceRoot.getCVSFolderFor(ioRoot);
runtime = Runtime.getRuntime();
global = flatenOptions(globalOptions);
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
index e5df2863b..975c9adfa 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
@@ -11,14 +11,16 @@ import java.io.PrintStream;
import java.text.ParseException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Session;
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.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.EntryFileDateFormat;
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFileTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFileTest.java
index d7fcb0ebc..a48ebbffa 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFileTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFileTest.java
@@ -13,10 +13,11 @@ import junit.awtui.TestRunner;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFolderTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFolderTest.java
index 57913e7fb..1c767ad90 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFolderTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/LocalFolderTest.java
@@ -10,11 +10,12 @@ import junit.awtui.TestRunner;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/SynchronizerTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/SynchronizerTest.java
index f639f6318..d71bc8eca 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/SynchronizerTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/SynchronizerTest.java
@@ -21,13 +21,14 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
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.CVSTag;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.resources.ICVSFile;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
import org.eclipse.team.internal.ccvs.core.resources.LocalResource;
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CommandsTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CommandsTest.java
index 23b2fc7cc..7dc6e1a5d 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CommandsTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CommandsTest.java
@@ -11,10 +11,12 @@ import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Session;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.util.FileUtil;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
import org.eclipse.team.tests.ccvs.core.JUnitTestCase;
@@ -358,7 +360,7 @@ public class CommandsTest extends JUnitTestCase {
// check that the resource has acctually a new timestamp
waitMsec(4000);
writeToFile(file2,fileContent2);
- assertEquals(true, Session.getManagedFolder(ioFolder4).getFile("c.txt").isModified());
+ assertEquals(true, CVSWorkspaceRoot.getCVSFolderFor(ioFolder4).getFile("c.txt").isModified());
// Should be able to set globalOptions to new String[0]
execute("ci",new String[0],
@@ -459,7 +461,7 @@ public class CommandsTest extends JUnitTestCase {
public void testImport() throws Exception {
File ioFolder = ioFolder1;
- ICVSFolder mFolder = Session.getManagedFolder(ioFolder);
+ ICVSFolder mFolder = CVSWorkspaceRoot.getCVSFolderFor(ioFolder);
String[] fileStructure = new String[]{"im/a.txt","im/f1/a.txt","im/f1/b.txt"};
createRandomFile(ioFolder,fileStructure);
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
index 6b21dacc0..7148efcea 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
@@ -16,14 +16,16 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSTag;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.sync.IRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
import org.eclipse.team.internal.ccvs.core.resources.RemoteModule;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
@@ -97,7 +99,7 @@ public class ModuleTest extends EclipseTest {
}
// Import the project into CVS
- Session s = new Session(getRepository(), Session.getManagedFolder(new File(url.getPath())));
+ Session s = new Session(getRepository(), CVSWorkspaceRoot.getCVSFolderFor(new File(url.getPath())));
s.open(DEFAULT_MONITOR);
try {
Command.IMPORT.execute(s, Command.NO_GLOBAL_OPTIONS,
@@ -113,8 +115,8 @@ public class ModuleTest extends EclipseTest {
// XXX Temporary method of checkout (i.e. with vcm_meta
protected IProject checkoutProject(String projectName, CVSTag tag) throws TeamException {
IProject project = super.checkoutProject(getWorkspace().getRoot().getProject(projectName), null, tag);
- ICVSFolder parent = (ICVSFolder)Session.getManagedResource(project);
- ICVSResource vcmmeta = Session.getManagedResource(project.getFile(".vcm_meta"));
+ ICVSFolder parent = (ICVSFolder)CVSWorkspaceRoot.getCVSResourceFor(project);
+ ICVSResource vcmmeta = CVSWorkspaceRoot.getCVSResourceFor(project.getFile(".vcm_meta"));
if ( ! vcmmeta.isManaged() && ! parent.getFolderSyncInfo().getIsStatic()) {
getProvider(project).add(new IResource[] {project.getFile(".vcm_meta")}, IResource.DEPTH_INFINITE, DEFAULT_MONITOR);
waitMsec(1000);
@@ -144,7 +146,7 @@ public class ModuleTest extends EclipseTest {
uploadProject("project1");
IProject project1 = checkoutProject("project1", null);
IRemoteSyncElement tree = getProvider(project1).getRemoteSyncTree(project1, CVSTag.DEFAULT, DEFAULT_MONITOR);
- assertEquals(Path.EMPTY, Session.getManagedResource(project1), (ICVSResource)tree.getRemote(), false, false);
+ assertEquals(Path.EMPTY, CVSWorkspaceRoot.getCVSResourceFor(project1), (ICVSResource)tree.getRemote(), false, false);
RemoteModule module = getRemoteModule("project1");
assertEquals(Path.EMPTY, (RemoteFolder)tree.getRemote(), module, false);
}
@@ -160,13 +162,13 @@ public class ModuleTest extends EclipseTest {
IProject docs = checkoutProject("docs", null);
IRemoteSyncElement tree = getProvider(docs).getRemoteSyncTree(docs, CVSTag.DEFAULT, DEFAULT_MONITOR);
- assertEquals(Path.EMPTY, Session.getManagedResource(docs), (ICVSResource)tree.getRemote(), false, false);
+ assertEquals(Path.EMPTY, CVSWorkspaceRoot.getCVSResourceFor(docs), (ICVSResource)tree.getRemote(), false, false);
RemoteModule module = getRemoteModule("docs");
assertEquals(Path.EMPTY, (RemoteFolder)tree.getRemote(), module, false);
IProject macros = checkoutProject("macros", null);
tree = getProvider(macros).getRemoteSyncTree(macros, CVSTag.DEFAULT, DEFAULT_MONITOR);
- assertEquals(Path.EMPTY, Session.getManagedResource(macros), (ICVSResource)tree.getRemote(), false, false);
+ assertEquals(Path.EMPTY, CVSWorkspaceRoot.getCVSResourceFor(macros), (ICVSResource)tree.getRemote(), false, false);
module = getRemoteModule("macros");
assertEquals(Path.EMPTY, (RemoteFolder)tree.getRemote(), module, false);
@@ -184,14 +186,14 @@ public class ModuleTest extends EclipseTest {
uploadProject("project2");
IProject project2 = checkoutProject("project2", null);
IRemoteSyncElement tree = getProvider(project2).getRemoteSyncTree(project2, CVSTag.DEFAULT, DEFAULT_MONITOR);
- assertEquals(Path.EMPTY, Session.getManagedResource(project2), (ICVSResource)tree.getRemote(), false, false);
+ assertEquals(Path.EMPTY, CVSWorkspaceRoot.getCVSResourceFor(project2), (ICVSResource)tree.getRemote(), false, false);
RemoteModule module = getRemoteModule("project2");
assertEquals(Path.EMPTY, (RemoteFolder)tree.getRemote(), module, false);
project2 = checkoutProject("project2-only", null);
tree = getProvider(project2).getRemoteSyncTree(project2, CVSTag.DEFAULT, DEFAULT_MONITOR);
- assertEquals(Path.EMPTY, Session.getManagedResource(project2), (ICVSResource)tree.getRemote(), false, false);
+ assertEquals(Path.EMPTY, CVSWorkspaceRoot.getCVSResourceFor(project2), (ICVSResource)tree.getRemote(), false, false);
module = getRemoteModule("project2-only");
assertEquals(Path.EMPTY, (RemoteFolder)tree.getRemote(), module, false);
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
index 662fc3326..dfaa793e2 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
@@ -15,21 +15,24 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSTag;
import org.eclipse.team.ccvs.core.CVSTeamProvider;
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.ICVSResource;
import org.eclipse.team.ccvs.core.ILogEntry;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.sync.IRemoteResource;
import org.eclipse.team.core.sync.IRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Session;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.resources.*;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTree;
-import org.eclipse.team.internal.ccvs.core.util.RemoteFolderTreeBuilder;
+import org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
import org.eclipse.team.tests.ccvs.core.JUnitTestCase;
@@ -51,7 +54,7 @@ public class RemoteResourceTest extends EclipseTest {
}
protected void assertRemoteMatchesLocal(String message, RemoteFolder remote, IContainer container) throws CVSException, IOException, CoreException {
- assertEquals(Path.EMPTY, (ICVSResource)remote, Session.getManagedFolder(container.getLocation().toFile()), false, false);
+ assertEquals(Path.EMPTY, (ICVSResource)remote, CVSWorkspaceRoot.getCVSFolderFor(container.getLocation().toFile()), false, false);
}
protected void getMembers(ICVSRemoteFolder folder, boolean deep) throws TeamException {
@@ -108,7 +111,7 @@ public class RemoteResourceTest extends EclipseTest {
*/
public void testGetBase() throws TeamException, CoreException, IOException {
IProject project = createProject("testGetBase", new String[] { "file1.txt", "file2.txt", "folder1/a.txt", "folder2/folder3/b.txt"});
- RemoteFolderTree tree = RemoteFolderTreeBuilder.buildBaseTree(getRepository(), Session.getManagedFolder(project.getLocation().toFile()), CVSTag.DEFAULT, DEFAULT_MONITOR);
+ RemoteFolderTree tree = RemoteFolderTreeBuilder.buildBaseTree(getRepository(), CVSWorkspaceRoot.getCVSFolderFor(project.getLocation().toFile()), CVSTag.DEFAULT, DEFAULT_MONITOR);
assertRemoteMatchesLocal("testGetBase", tree, project);
}
@@ -166,7 +169,7 @@ public class RemoteResourceTest extends EclipseTest {
IProject project = createProject("testGetRemoteResource", new String[] { "file1.txt", "folder1/", "folder1/a.txt", "folder2/", "folder2/a.txt", "folder2/folder3/", "folder2/folder3/b.txt", "folder2/folder3/c.txt"});
ICVSRemoteResource file = getProvider(project).getRemoteResource(project.getFile("folder1/a.txt"));
assertTrue("File should exist remotely", file.exists());
- assertEquals(Path.EMPTY, (ICVSResource)file, (ICVSResource)Session.getManagedFile(project.getFile("folder1/a.txt").getLocation().toFile()), false, false);
+ assertEquals(Path.EMPTY, (ICVSResource)file, (ICVSResource)CVSWorkspaceRoot.getRemoteFileFor(project.getFile("folder1/a.txt").getLocation().toFile()), false, false);
ICVSRemoteResource folder = getProvider(project).getRemoteResource(project.getFolder("folder2/folder3/"));
getMembers((ICVSRemoteFolder)folder, true);
assertTrue("Folder should exist remotely", folder.exists());
@@ -197,7 +200,7 @@ public class RemoteResourceTest extends EclipseTest {
project = checkoutCopy(project, v1Tag);
// Compare the two
- assertEquals(Path.EMPTY, (ICVSResource)tree.getRemote(), (ICVSResource)Session.getManagedResource(project), false, false);
+ assertEquals(Path.EMPTY, (ICVSResource)tree.getRemote(), (ICVSResource)CVSWorkspaceRoot.getCVSResourceFor(project), false, false);
}
/*
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java
index 68922d9ac..f7c996d0e 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/SyncElementTest.java
@@ -16,7 +16,9 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.team.ccvs.core.*;
import org.eclipse.team.ccvs.core.CVSTag;
+import org.eclipse.team.ccvs.core.ICVSResource;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.sync.ILocalSyncElement;
import org.eclipse.team.core.sync.IRemoteResource;
@@ -25,7 +27,7 @@ import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.core.resources.CVSRemoteSyncElement;
-import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
import org.eclipse.team.tests.ccvs.core.JUnitTestCase;
@@ -719,7 +721,7 @@ public class SyncElementTest extends EclipseTest {
// Get the sync tree for the project
IRemoteSyncElement tree = getProvider(project).getRemoteSyncTree(project, CVSTag.DEFAULT, DEFAULT_MONITOR);
- assertEquals(Path.EMPTY, (ICVSResource)tree.getBase(), Session.getManagedResource(copy), false, false);
+ assertEquals(Path.EMPTY, (ICVSResource)tree.getBase(), CVSWorkspaceRoot.getCVSResourceFor(copy), false, false);
}
@@ -778,6 +780,6 @@ public class SyncElementTest extends EclipseTest {
// Sync on the original and assert the result equals the copy
IRemoteSyncElement tree = getProvider(project).getRemoteSyncTree(project, null, DEFAULT_MONITOR);
- assertEquals(Path.EMPTY, (ICVSResource)tree.getRemote(), Session.getManagedResource(copy), false, false);
+ assertEquals(Path.EMPTY, (ICVSResource)tree.getRemote(), CVSWorkspaceRoot.getCVSResourceFor(copy), false, false);
}
} \ No newline at end of file

Back to the top