Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-06-11 17:24:39 -0400
committerMichael Valenta2002-06-11 17:24:39 -0400
commit1e80da09a2c92194fe75481745339106e6f246d7 (patch)
tree4285544cecdc8a0139e4dff0e521a0ead7a9d45c
parentd3eabf21578d8834a7a67d9a2872194ba5e5ee69 (diff)
downloadeclipse.platform.team-1e80da09a2c92194fe75481745339106e6f246d7.tar.gz
eclipse.platform.team-1e80da09a2c92194fe75481745339106e6f246d7.tar.xz
eclipse.platform.team-1e80da09a2c92194fe75481745339106e6f246d7.zip
Conversion from nature to persistant property
-rw-r--r--bundles/org.eclipse.team.cvs.core/plugin.xml11
-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/CVSTeamProvider.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot.java11
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AddDeleteMoveListener.java2
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ProjectDescriptionManager.java24
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.properties3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UnmanageAction.java2
8 files changed, 29 insertions, 50 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/plugin.xml b/bundles/org.eclipse.team.cvs.core/plugin.xml
index 28dd981f1..5a4aaf4c0 100644
--- a/bundles/org.eclipse.team.cvs.core/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.core/plugin.xml
@@ -22,7 +22,7 @@
<extension-point name="Authenticator" id="authenticator"/>
<extension-point name="ConnectionMethods" id="connectionmethods"/>
- <!-- *************** Conection Methods **************** -->
+ <!-- *************** Connection Methods **************** -->
<extension id="pserver" point="org.eclipse.team.cvs.core.connectionmethods">
<adapter>
<run class="org.eclipse.team.internal.ccvs.core.connection.PServerConnectionMethod">
@@ -39,6 +39,15 @@
</adapter>
</extension>
+ <!-- *************** Repository Provider **************** -->
+ <extension
+ point="org.eclipse.team.core.repository">
+ <repository
+ class="org.eclipse.team.internal.ccvs.core.CVSTeamProvider"
+ id="org.eclipse.team.cvs.core.cvsnature">
+ </repository>
+ </extension>
+
<!-- *************** Project Nature **************** -->
<extension point="org.eclipse.core.resources.natures" id="cvsnature" name="%cvsNature">
<runtime>
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 749ec671a..546a10cc4 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
@@ -178,10 +178,7 @@ public class CVSProvider implements ICVSProvider {
for (int i = 0; i < projects.length; i++) {
IProject project = projects[i];
// Register the project with Team
- // (unless the project already has the proper nature from the project meta-information)
- if (!project.getDescription().hasNature(CVSProviderPlugin.getTypeId())) {
- Team.addNatureToProject(project, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(monitor, 100));
- }
+ RepositoryProvider.map(project, CVSProviderPlugin.getTypeId());
}
} finally {
@@ -481,15 +478,8 @@ public class CVSProvider implements ICVSProvider {
folder.setFolderSyncInfo(new FolderSyncInfo(moduleName, location.getLocation(), null, false));
- // Register the project with Team
- // (unless the project already has the proper nature from the project meta-information)
- try {
- if (!project.getDescription().hasNature(CVSProviderPlugin.getTypeId())) {
- Team.addNatureToProject(project, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(monitor, 1));
- }
- } catch (CoreException e) {
- throw wrapException(e);
- }
+ //Register it with Team. If it already is, no harm done.
+ RepositoryProvider.map(project, CVSProviderPlugin.getTypeId());
} catch (TeamException e) {
// The checkout may have triggered password caching
// Therefore, if this is a newly created location, we want to clear its cache
@@ -547,13 +537,7 @@ public class CVSProvider implements ICVSProvider {
}
// Register the project with Team
- // (unless the project already has the proper nature from the project meta-information)
- try {
- if (!project.getDescription().hasNature(CVSProviderPlugin.getTypeId()))
- Team.addNatureToProject(project, CVSProviderPlugin.getTypeId(), monitor);
- } catch (CoreException e) {
- throw wrapException(e);
- }
+ RepositoryProvider.map(project, CVSProviderPlugin.getTypeId());
}
private CVSException wrapException(CoreException e) {
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 31f9b8002..7a1607b25 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
@@ -497,7 +497,7 @@ public class CVSTeamProvider extends RepositoryProvider {
} catch (CVSException e) {
// If we can't get the remote location, we should disconnect since nothing can be done with the provider
try {
- Team.removeNatureFromProject(project, CVSProviderPlugin.getTypeId(), Policy.monitorFor(null));
+ RepositoryProvider.unmap(project);
} catch (TeamException ex) {
CVSProviderPlugin.log(ex);
}
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
index 2ae43b476..5425b54fe 100644
--- 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
@@ -14,6 +14,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.Team;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.sync.IRemoteSyncElement;
@@ -148,13 +149,9 @@ public class CVSWorkspaceRoot {
RemoteFolderTree remote = RemoteFolderTreeBuilder.buildRemoteTree((CVSRepositoryLocation)folder.getRepository(), folder, folder.getTag(), Policy.subMonitorFor(progress, 80));
CVSRemoteSyncElement tree = new CVSRemoteSyncElement(true /*three way*/, project, null, remote);
tree.makeFoldersInSync(Policy.subMonitorFor(progress, 10));
- try {
- if (!project.getDescription().hasNature(CVSProviderPlugin.getTypeId())) {
- Team.addNatureToProject(project, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(progress, 10));
- }
- } catch (CoreException e) {
- throw CVSException.wrapException(e);
- }
+
+ RepositoryProvider.map(project, CVSProviderPlugin.getTypeId());
+
progress.done();
return tree;
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AddDeleteMoveListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AddDeleteMoveListener.java
index 595bf2d22..bbb5bfa01 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AddDeleteMoveListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AddDeleteMoveListener.java
@@ -212,7 +212,7 @@ public class AddDeleteMoveListener implements IResourceDeltaVisitor, IResourceCh
ICVSFolder folder = CVSWorkspaceRoot.getCVSFolderFor(resource.getProject());
try {
if (! folder.isCVSFolder()) {
- Team.removeNatureFromProject(resource.getProject(), CVSProviderPlugin.getTypeId(), null);
+ RepositoryProvider.unmap(resource.getProject());
}
} catch (TeamException e) {
CVSProviderPlugin.log(e.getStatus());
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ProjectDescriptionManager.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ProjectDescriptionManager.java
index 032a96096..c9b134a8c 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ProjectDescriptionManager.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/ProjectDescriptionManager.java
@@ -168,25 +168,11 @@ public class ProjectDescriptionManager implements IResourceChangeListener {
// Other natures are still set
Util.logError(Policy.bind("ProjectDescriptionManager.unableToSetDescription"), ex); //$NON-NLS-1$
}
- // Make sure we have the cvs nature (the above read may have removed it)
- if (!project.getDescription().hasNature(CVSProviderPlugin.getTypeId())) {
- try {
- // TeamPlugin.addNatureToProject(project, CVSProviderPlugin.getTypeId(), progress);
-
- // Set the nature manually in order to override any .project file
- IProjectDescription description = project.getDescription();
- String[] prevNatures= description.getNatureIds();
- String[] newNatures= new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
- newNatures[prevNatures.length]= CVSProviderPlugin.getTypeId();
- description.setNatureIds(newNatures);
- project.setDescription(description, IResource.FORCE | IResource.KEEP_HISTORY, progress);
- } catch (CoreException ex) {
- // Failing to set the provider is probably due to a missing nature.
- // Other natures are still set
- Util.logError(Policy.bind("ProjectDescriptionManager.unableToSetDescription"), ex); //$NON-NLS-1$
- }
- }
+
+ // Make sure we are still marked as a CVS project
+ if(RepositoryProvider.getProvider(project, CVSProviderPlugin.getTypeId()) == null)
+ RepositoryProvider.map(project, CVSProviderPlugin.getTypeId());
+
// Mark the .vcm_meta file with a problem marker
if (project.getFile(CORE_PROJECT_DESCRIPTION_PATH).exists()) {
createVCMMetaMarker(descResource);
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.properties b/bundles/org.eclipse.team.cvs.ui/plugin.properties
index 905c5589d..5f1f449dc 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.properties
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.properties
@@ -41,6 +41,9 @@ CompareWithTagAction.tooltip=Compare with a Branch or a Version on the CVS Serve
ContentAction.label=Compare File Contents
ContentAction.tooltip=Use File Contents Instead of Timestamps When Comparing
+ConvertNature.label=Convert Provider from Nature
+ConvertNature.tooltip=Converts a CVS project from using natures to using properties
+
CopyRepositoryNameAction.label=&Copy to Clipboard
CopyRepositoryNameAction.tooltip=Copy Repository Names to Clipboard
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 c834e6792..32e8addad 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
@@ -162,7 +162,7 @@ public class UnmanageAction extends TeamAction {
}
} finally {
// We want to remove the nature even if the unmanage operation fails
- Team.removeNatureFromProject((IProject)resource, CVSProviderPlugin.getTypeId(), Policy.subMonitorFor(subMonitor, 10));
+ RepositoryProvider.unmap((IProject)resource);
}
}
}

Back to the top