Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalgorzata Janczarska2012-10-31 15:06:07 +0000
committerMalgorzata Janczarska2012-10-31 15:06:07 +0000
commitb5dcf67fe304d69b6ba81d5d1cdaca10ecb32041 (patch)
treeadf4d1f80ea298b2f1e558c0673cd60244628d5b /bundles/org.eclipse.team.core/src
parentd6fbf99046f2aec01c425c2c618d7589e56c5a70 (diff)
downloadeclipse.platform.team-b5dcf67fe304d69b6ba81d5d1cdaca10ecb32041.tar.gz
eclipse.platform.team-b5dcf67fe304d69b6ba81d5d1cdaca10ecb32041.tar.xz
eclipse.platform.team-b5dcf67fe304d69b6ba81d5d1cdaca10ecb32041.zip
Bug 362219 -Synchronize with Workspace errors with "outer scope rule"v20121031-150607I20121106-0800I20121031-2000
when new file is not under an existing folder
Diffstat (limited to 'bundles/org.eclipse.team.core/src')
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java
index d6a4c374e..eb4dc5a41 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/MergeContext.java
@@ -409,7 +409,8 @@ public abstract class MergeContext extends SynchronizationContext implements IMe
}
/**
- * Default implementation that returns the resource itself.
+ * Default implementation that returns the resource itself if it exists
+ * and the first existing parent if the resource does not exist.
* Subclass should override to provide the appropriate rule.
* @see org.eclipse.team.core.mapping.IMergeContext#getMergeRule(IDiff)
*/
@@ -418,6 +419,12 @@ public abstract class MergeContext extends SynchronizationContext implements IMe
IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
ISchedulingRule rule;
if (!resource.exists()) {
+ // for additions return rule for all parents that need to be created
+ IContainer parent = resource.getParent();
+ while (!parent.exists()) {
+ resource = parent;
+ parent = parent.getParent();
+ }
rule = ruleFactory.createRule(resource);
} else if (SyncInfoToDiffConverter.getRemote(diff) == null){
rule = ruleFactory.deleteRule(resource);

Back to the top