[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Patch for fixing Link with Editor on SVN Resource History

From: Erich Bratton <EBratton_at_cardean.com>
Date: 2005-11-01 21:04:25 CET

Hello all,
 
We have started using svn recently, and we had been diehard cvs users in
Eclipse. I was very very fond of the Link with Editor on the cvs
history window, and was disappointed to find that it was not functioning
in Subclipse 0.9.31 or .32 or .34. I patched up one file and it seems
to work, and I submit it here for your reviewing, editing, and possible
inclusion in future release pleasure. :-) It also seems to work in
.36.

Index:
C:/Dev/eclipse-SDK-3.0.1-win32/eclipse/workspace/ui/src/org/tigris/subve
rsion/subclipse/ui/history/HistoryView.java
===================================================================

---
C:/Dev/eclipse-SDK-3.0.1-win32/eclipse/workspace/ui/src/org/tigris/subve
rsion/subclipse/ui/history/HistoryView.java	(revision 1706)
+++
C:/Dev/eclipse-SDK-3.0.1-win32/eclipse/workspace/ui/src/org/tigris/subve
rsion/subclipse/ui/history/HistoryView.java	(working copy)
@@ -72,7 +72,9 @@
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.team.core.RepositoryProvider;
 import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.synchronize.SyncInfo;
 import org.eclipse.team.core.variants.IResourceVariant;
+import org.eclipse.team.ui.synchronize.SyncInfoCompareInput;
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
@@ -101,6 +103,7 @@
 import org.tigris.subversion.subclipse.core.history.LogEntry;
 import org.tigris.subversion.subclipse.core.history.LogEntryChangePath;
 import org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot;
+import org.tigris.subversion.subclipse.core.sync.SVNStatusSyncInfo;
 import org.tigris.subversion.subclipse.ui.IHelpContextIds;
 import org.tigris.subversion.subclipse.ui.ISVNUIConstants;
 import org.tigris.subversion.subclipse.ui.Policy;
@@ -1007,22 +1010,20 @@
         
 		IEditorInput input = editor.getEditorInput();
 		// Handle compare editors opened from the Synchronize
View
-		// TODO uncommnet when there is sync support        
-		//        if (input instanceof SyncInfoCompareInput) {
-		//            SyncInfoCompareInput syncInput =
(SyncInfoCompareInput) input;
-		//            SyncInfo info = syncInput.getSyncInfo();
-		//            if(info instanceof SVNSyncInfo &&
info.getLocal().getType() == IResource.FILE) {
-		//                ISVNRemoteFile remote =
(ISVNRemoteFile)info.getRemote();
-		//                ISVNRemoteFile base =
(ISVNRemoteFile)info.getBase();
-		//                if(remote != null) {
-		//                    showHistory(remote, false);
-		//                } else if(base != null) {
-		//                    showHistory(base, false);
-		//                }
-		//            }
-		//        // Handle editors opened on remote files
-		//        } else
-		if(input instanceof RemoteFileEditorInput) {
+		if (input instanceof SyncInfoCompareInput) {
+        	SyncInfoCompareInput syncInput = (SyncInfoCompareInput)
input;
+            SyncInfo info = syncInput.getSyncInfo();
+            if(info instanceof SVNStatusSyncInfo &&
info.getLocal().getType() == IResource.FILE) {
+                ISVNRemoteFile remote =
(ISVNRemoteFile)info.getRemote();
+                ISVNRemoteFile base = (ISVNRemoteFile)info.getBase();
+                if(remote != null) {
+                    showHistory(remote, false);
+                } else if(base != null) {
+                    showHistory(base, false);
+                }
+            }
+        // Handle editors opened on remote files
+        } else if(input instanceof RemoteFileEditorInput) {
 			ISVNRemoteFile remote =
((RemoteFileEditorInput)input).getSVNRemoteFile();
 			if(remote != null) {
 				showHistory(remote, false);
 
Erich Bratton
Director of Software Development
Ellis College www.ellis.nyit.edu | Cardean University www.cardean.edu 
Received on Wed Nov 2 07:04:25 2005

This is an archived mail posted to the Subclipse Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.