Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-09-11 17:03:28 -0400
committerJean Michel-Lemieux2003-09-11 17:03:28 -0400
commitc4d4c2f8c746d994cb405fe8821efecffc30c9f6 (patch)
tree92c1b9482052d54830f3c9beee09e5a41f8466b1
parente6a3bb688f4ed98557bf5a41703ae0431a9405dd (diff)
downloadeclipse.platform.team-c4d4c2f8c746d994cb405fe8821efecffc30c9f6.tar.gz
eclipse.platform.team-c4d4c2f8c746d994cb405fe8821efecffc30c9f6.tar.xz
eclipse.platform.team-c4d4c2f8c746d994cb405fe8821efecffc30c9f6.zip
Bug 39145 [live sync view] revision # not shown in compare editor
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SyncInfo.java10
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java22
2 files changed, 32 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SyncInfo.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SyncInfo.java
index d916405a4..e35305332 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SyncInfo.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SyncInfo.java
@@ -152,6 +152,16 @@ public class SyncInfo implements IAdaptable {
public IResource getLocal() {
return local;
}
+
+ /**
+ * Returns the content identifier for the local resource or <code>null</code> if
+ * it doesn't have one. For example, in CVS this would be the revision number.
+ *
+ * @return String that could be displayed to the user to identify this resource.
+ */
+ public String getLocalContentIdentifier() {
+ return null;
+ }
/**
* Returns the remote resource handle for the base resource,
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java
index b9fc5475a..f6bd0e402 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSSyncInfo.java
@@ -11,6 +11,7 @@
package org.eclipse.team.internal.ccvs.core;
import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
@@ -324,4 +325,25 @@ public class CVSSyncInfo extends SyncInfo {
}
return result.toString();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.core.subscribers.SyncInfo#getContentIdentifier()
+ */
+ public String getLocalContentIdentifier() {
+ try {
+ IResource local = getLocal();
+ if (local != null || local.getType() == IResource.FILE) {
+ // it's a file, return the revision number if we can find one
+ ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile) local);
+ ResourceSyncInfo info = cvsFile.getSyncInfo();
+ if (info != null) {
+ return info.getRevision();
+ }
+ }
+ } catch (CVSException e) {
+ CVSProviderPlugin.log(e);
+ return null;
+ }
+ return null;
+ }
}

Back to the top