Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Constant2016-03-22 17:17:53 +0000
committerOlivier Constant2016-03-22 17:17:53 +0000
commit4d90cd74b818ba6c62a972c0524da74315ef0cae (patch)
treeaedf3edf12c7804c0ba6ecfb949381d7ea92516d /plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector
parentcb7d2b8052b1e200a1774b01f70ff1a8b3eaed0c (diff)
downloadorg.eclipse.emf.diffmerge.core-4d90cd74b818ba6c62a972c0524da74315ef0cae.tar.gz
org.eclipse.emf.diffmerge.core-4d90cd74b818ba6c62a972c0524da74315ef0cae.tar.xz
org.eclipse.emf.diffmerge.core-4d90cd74b818ba6c62a972c0524da74315ef0cae.zip
Fixed SVN conflict handling
Change-Id: I197a0fea434c423b9183e2e341c2c3fdad042333 Signed-off-by: Olivier Constant <olivier.constant@thalesgroup.com>
Diffstat (limited to 'plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector')
-rw-r--r--plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNLocalScopeDefinitionFactory.java2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNRemoteScopeDefinitionFactory.java2
-rw-r--r--plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNRevisionScopeDefinitionFactory.java26
3 files changed, 22 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNLocalScopeDefinitionFactory.java b/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNLocalScopeDefinitionFactory.java
index a46c3d04..73050d19 100644
--- a/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNLocalScopeDefinitionFactory.java
+++ b/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNLocalScopeDefinitionFactory.java
@@ -20,7 +20,7 @@ import org.eclipse.team.svn.ui.compare.ResourceCompareInput.ResourceElement;
/**
- * A scopes definition factory for local SVN files.
+ * A scope definition factory for local SVN files.
*/
public class SVNLocalScopeDefinitionFactory extends URIScopeDefinitionFactory {
diff --git a/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNRemoteScopeDefinitionFactory.java b/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNRemoteScopeDefinitionFactory.java
index 981a7e20..ed5df18a 100644
--- a/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNRemoteScopeDefinitionFactory.java
+++ b/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNRemoteScopeDefinitionFactory.java
@@ -25,7 +25,7 @@ import org.eclipse.team.svn.ui.compare.ResourceCompareInput.ResourceElement;
/**
- * A scopes definition factory for remote SVN files.
+ * A scope definition factory for remote SVN files.
*/
public class SVNRemoteScopeDefinitionFactory extends AbstractURIConvertingScopeDefinitionFactory {
diff --git a/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNRevisionScopeDefinitionFactory.java b/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNRevisionScopeDefinitionFactory.java
index 8879f554..d4cc071a 100644
--- a/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNRevisionScopeDefinitionFactory.java
+++ b/plugins/org.eclipse.emf.diffmerge.connector.svn/src/org/eclipse/emf/diffmerge/connector/svn/ext/SVNRevisionScopeDefinitionFactory.java
@@ -12,11 +12,13 @@
package org.eclipse.emf.diffmerge.connector.svn.ext;
import org.eclipse.compare.ITypedElement;
+import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.diffmerge.connector.core.ext.AbstractRevisionScopeDefinitionFactory;
import org.eclipse.emf.diffmerge.connector.svn.Messages;
import org.eclipse.emf.ecore.resource.URIConverter;
+import org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.svn.core.connector.SVNRevision;
@@ -24,11 +26,12 @@ import org.eclipse.team.svn.core.resource.ILocalResource;
import org.eclipse.team.svn.core.resource.IRepositoryLocation;
import org.eclipse.team.svn.core.svnstorage.SVNRemoteStorage;
import org.eclipse.team.svn.core.synchronize.variant.BaseFileVariant;
+import org.eclipse.team.svn.core.synchronize.variant.RemoteFileVariant;
/**
* A scope definition factory for file revisions in SVN history.
- * It is used in the Team Synchronizing perspective.
+ * It is used in the Team Synchronizing perspective for the ancestor and remote scopes.
*/
public class SVNRevisionScopeDefinitionFactory extends AbstractRevisionScopeDefinitionFactory {
@@ -37,13 +40,12 @@ public class SVNRevisionScopeDefinitionFactory extends AbstractRevisionScopeDefi
*/
@Override
protected String getLabelForRevision(IFileRevision revision_p, ITypedElement entrypoint_p) {
- String result;
+ String result = null;
IResourceVariant variant = getVariant(revision_p);
- if (variant instanceof BaseFileVariant) {
+ if (variant != null) {
+ // Ancestor or remote
result = String.format(
Messages.SVNRevisionScopeDefinitionFactory_LabelRevision, variant.getContentIdentifier());
- } else {
- result = super.getLabelForRevision(revision_p, entrypoint_p);
}
return result;
}
@@ -56,9 +58,13 @@ public class SVNRevisionScopeDefinitionFactory extends AbstractRevisionScopeDefi
URIConverter result = null;
IResourceVariant variant = getVariant(revision_p);
if (variant instanceof BaseFileVariant) {
+ // Ancestor
ILocalResource res =((BaseFileVariant)variant).getResource();
IRepositoryLocation location = SVNRemoteStorage.instance().getRepositoryLocation(res.getResource());
result = new SVNHistoryURIConverter(location, SVNRevision.fromString(variant.getContentIdentifier()));
+ } else {
+ // Remote
+ result = new ExtensibleURIConverterImpl();
}
return result;
}
@@ -71,10 +77,16 @@ public class SVNRevisionScopeDefinitionFactory extends AbstractRevisionScopeDefi
URI result = null;
IResourceVariant variant = getVariant(revision_p);
if (variant instanceof BaseFileVariant) {
+ // Ancestor
ILocalResource res = ((BaseFileVariant)variant).getResource();
IRepositoryLocation location = SVNRemoteStorage.instance().getRepositoryLocation(res.getResource());
result = URI.createURI(location.getRepositoryRootUrl() +
((BaseFileVariant)variant).getResource().getResource().getFullPath(), true);
+ } else {
+ // Remote
+ IStorage storage = getStorage(revision_p);
+ if (storage != null)
+ result = toFileURI(storage.getFullPath().toString());
}
return result;
}
@@ -84,7 +96,9 @@ public class SVNRevisionScopeDefinitionFactory extends AbstractRevisionScopeDefi
*/
@Override
protected boolean isApplicableToRevision(IFileRevision revision_p, ITypedElement entrypoint_p) {
- return getVariant(revision_p) instanceof BaseFileVariant;
+ IResourceVariant variant = getVariant(revision_p);
+ // Ancestor and remote
+ return variant instanceof BaseFileVariant || variant instanceof RemoteFileVariant;
}
}

Back to the top