Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/SynchronizedTargetProvider.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/SynchronizedTargetProvider.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/SynchronizedTargetProvider.java
index 87f00898e..1c13ccc27 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/SynchronizedTargetProvider.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/SynchronizedTargetProvider.java
@@ -9,6 +9,7 @@ import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
import org.eclipse.core.resources.ISynchronizer;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -55,6 +56,10 @@ public abstract class SynchronizedTargetProvider extends TargetProvider {
/*************** State Factory ***************/
+ public void registerWithSynchronizer() {
+ getSynchronizer().add(getIdentifier());
+ }
+
/**
* Answers the synchronizer.
*/
@@ -319,14 +324,14 @@ public abstract class SynchronizedTargetProvider extends TargetProvider {
*/
public void setProject(IProject project) {
super.setProject(project);
- try {
- restoreConfiguration();
+/* try {
+ restoreConfiguration(); This will fail because root is null first time
} catch (CoreException e) {
TeamPlugin.log(IStatus.ERROR, "Error configuring project", e);
} catch (IOException e) {
TeamPlugin.log(IStatus.ERROR, "Error configuring project", e);
}
- }
+*/ }
@@ -369,6 +374,8 @@ public abstract class SynchronizedTargetProvider extends TargetProvider {
configure(configuration);
// Store the new configuration for future.
+ registerWithSynchronizer();
+
storeConfiguration(configuration);
}
@@ -380,13 +387,13 @@ public abstract class SynchronizedTargetProvider extends TargetProvider {
/**
* Associates the given configuration with the given project.
- * Stores the configuration under the <code>getType()</code> key.
+ * Stores the configuration under the <code>getIdentifier()</code> key.
*/
private void storeConfiguration(Properties configuration) throws IOException, CoreException {
// Remove any old configuration first.
QualifiedName configKey = getIdentifier();
getSynchronizer().flushSyncInfo(configKey, getProject(), IResource.DEPTH_INFINITE);
-
+
// Flatten the configuration to bytes.
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
byteStream.write(CONFIG_FORMAT_VERSION);

Back to the top