Commit ea3406af authored by agurov's avatar agurov

NPE in CompareWithLatestRevisionAction [ID-D9JJ1] (bug 480129)

https://bugs.eclipse.org/bugs/show_bug.cgi?id=480129

git-svn-id: https://dev.eclipse.org/svnroot/technology/org.eclipse.subversive/trunk@21509 ee007c2a-0a25-0410-9ab9-bf268980928c
parent 1629b45c
......@@ -132,10 +132,14 @@ public final class SVNUtility {
}
location.setUrl(url);
}
public static IRepositoryResource getCopiedFrom(IResource resource) {
ILocalResource local = SVNRemoteStorage.instance().asLocalResource(resource);
return SVNUtility.getCopiedFrom(SVNRemoteStorage.instance().asLocalResource(resource));
}
public static IRepositoryResource getCopiedFrom(ILocalResource local) {
if (local.isCopied()) {
IResource resource = local.getResource();
IRepositoryLocation location = SVNRemoteStorage.instance().getRepositoryLocation(resource);
ISVNConnector proxy = location.acquireSVNProxy();
final String path = FileUtility.getWorkingCopyPath(resource);
......
......@@ -45,7 +45,10 @@ public class CompareWithLatestRevisionAction extends AbstractWorkingCopyAction {
IResource resource = this.getSelectedResources()[0];
ILocalResource local = SVNRemoteStorage.instance().asLocalResourceAccessible(resource);
IRepositoryResource remote = local.isCopied() ? SVNUtility.getCopiedFrom(resource) : SVNRemoteStorage.instance().asRepositoryResource(resource);
IRepositoryResource remote = SVNUtility.getCopiedFrom(local);
if (remote == null) {
remote = SVNRemoteStorage.instance().asRepositoryResource(resource);
}
remote.setSelectedRevision(SVNRevision.HEAD);
CompareResourcesOperation mainOp = new CompareResourcesOperation(local, remote);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment