From c182126521382a0c0dc29738c52338a9a54753fb Mon Sep 17 00:00:00 2001 From: lgoubet Date: Fri, 18 Jan 2013 13:20:27 +0100 Subject: [PATCH] [367475] Take git specificities into account when resolving uris. --- .../compare/ide/ui/logical/RevisionedURIConverter.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/logical/RevisionedURIConverter.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/logical/RevisionedURIConverter.java index 2fe4cab08..5a31d4418 100644 --- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/logical/RevisionedURIConverter.java +++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/logical/RevisionedURIConverter.java @@ -149,8 +149,19 @@ public final class RevisionedURIConverter extends StorageURIConverter { // Otherwise, load it from the repository (resource might not yet (or no longer) exist locally) final IResource targetFile; if (normalizedUri.isPlatform()) { - targetFile = ResourcesPlugin.getWorkspace().getRoot().getFile( - new Path(normalizedUri.trimFragment().toPlatformString(true))); + IPath platformString = new Path(normalizedUri.trimFragment().toPlatformString(true)); + IResource temp = ResourcesPlugin.getWorkspace().getRoot().getFile(platformString); + if (!temp.exists() && normalizedUri.isPlatformResource() && platformString.segmentCount() > 1) { + // We tend to get here with unresolvable URIs with git; as it tends to give URIs of the + // form + // platform:/resource// instead of the + // resolvable + // platform:/resource/ . We'll try for this case + targetFile = ResourcesPlugin.getWorkspace().getRoot().getFile( + platformString.removeFirstSegments(1)); + } else { + targetFile = temp; + } } else { /* * FIXME Deresolve the URI against the workspace root, if it cannot be done, delegate to -- 2.11.4.GIT