Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2004-02-01 15:16:44 -0500
committerJean Michel-Lemieux2004-02-01 15:16:44 -0500
commit548bdfe7a25afe56f3457d735fbe852332503e4c (patch)
tree9552a0755a598bd0680ce9e89b8e7a2b3bf87497
parenta0ccdec6424fc2df162fff928da3e35e742a6939 (diff)
downloadeclipse.platform.team-548bdfe7a25afe56f3457d735fbe852332503e4c.tar.gz
eclipse.platform.team-548bdfe7a25afe56f3457d735fbe852332503e4c.tar.xz
eclipse.platform.team-548bdfe7a25afe56f3457d735fbe852332503e4c.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SyncInfoSet.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNode.java15
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java47
-rw-r--r--bundles/org.eclipse.team.ui/TODO-syncview.txt10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoLabelProvider.java3
6 files changed, 57 insertions, 25 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SyncInfoSet.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SyncInfoSet.java
index 7c2b123ef..d573751e1 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SyncInfoSet.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SyncInfoSet.java
@@ -169,6 +169,11 @@ public class SyncInfoSet {
return new SyncInfo[] { info };
}
}
+ // if it's the root then return all out of sync resources.
+ if(resource.getType() == IResource.ROOT) {
+ return members();
+ }
+ // for folders return all children deep.
IContainer container = (IContainer)resource;
IPath path = container.getFullPath();
Set children = (Set)parents.get(path);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
index 731618974..776202a7e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSynchronizeViewCompareConfiguration.java
@@ -40,8 +40,6 @@ public class CVSSynchronizeViewCompareConfiguration extends TeamSubscriberPageDi
}
return output.toString();
}
- } else if(element instanceof ChangeLogDiffNode) {
- return ((ChangeLogDiffNode)element).getComment();
}
return text;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNode.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNode.java
index d944d111e..86a826856 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNode.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNode.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.team.core.subscribers.MutableSyncInfoSet;
import org.eclipse.team.core.subscribers.SyncInfo;
+import org.eclipse.team.internal.ccvs.core.ILogEntry;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.ui.synchronize.SyncInfoDiffNode;
@@ -23,15 +24,15 @@ import org.eclipse.ui.model.IWorkbenchAdapter;
public class ChangeLogDiffNode extends SyncInfoDiffNode implements IAdaptable, IWorkbenchAdapter {
- private String comment;
+ private ILogEntry logEntry;
- public ChangeLogDiffNode(DiffNode parent, String comment) {
+ public ChangeLogDiffNode(DiffNode parent, ILogEntry logEntry) {
super(parent, new MutableSyncInfoSet(), ResourcesPlugin.getWorkspace().getRoot());
- this.comment = comment;
+ this.logEntry = logEntry;
}
- public String getComment() {
- return comment;
+ public ILogEntry getComment() {
+ return logEntry;
}
public boolean equals(Object other) {
@@ -51,7 +52,7 @@ public class ChangeLogDiffNode extends SyncInfoDiffNode implements IAdaptable, I
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
*/
public String getLabel(Object o) {
- return comment;
+ return logEntry.getComment() + "(" + logEntry.getAuthor() +")";
}
public void add(SyncInfo info) {
@@ -62,6 +63,6 @@ public class ChangeLogDiffNode extends SyncInfoDiffNode implements IAdaptable, I
* @see org.eclipse.team.ui.synchronize.SyncInfoDiffNode#toString()
*/
public String toString() {
- return getComment();
+ return getLabel(null);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java
index 71ddf0754..13a3352b9 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogDiffNodeBuilder.java
@@ -15,13 +15,27 @@ import java.util.Map;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
-import org.eclipse.team.core.TeamException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.team.core.subscribers.*;
-import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.ui.synchronize.SyncInfoDiffNodeRoot;
import org.eclipse.team.ui.synchronize.views.SyncInfoDiffNodeBuilder;
+/**
+ * It would be very useful to support showing changes grouped logically
+ * instead of grouped physically. This could be used for showing incoming
+ * changes and also for showing the results of comparisons.
+ *
+ * Some problems with this:
+ * 1. you have to fetch the log entries to extract useful information by
+ * which to classify changes. this is expensive and can't be done in the
+ * ui thread.
+ *
+ * 2. how to support logical groupins based on any of the information in
+ * the log entry?
+ */
public class ChangeLogDiffNodeBuilder extends SyncInfoDiffNodeBuilder {
private Map commentRoots = new HashMap();
@@ -49,23 +63,30 @@ public class ChangeLogDiffNodeBuilder extends SyncInfoDiffNodeBuilder {
commentRoots.clear();
SyncInfo[] infos = set.members();
for (int i = 0; i < infos.length; i++) {
- String comment = getSyncInfoComment((CVSSyncInfo) infos[i]);
- ChangeLogDiffNode changeRoot = (ChangeLogDiffNode) commentRoots.get(comment);
- if (changeRoot == null) {
- changeRoot = new ChangeLogDiffNode(getRoot(), comment);
- commentRoots.put(comment, changeRoot);
+ ILogEntry logEntry = getSyncInfoComment((CVSSyncInfo) infos[i]);
+ if(logEntry != null) {
+ String comment = logEntry.getComment();
+ ChangeLogDiffNode changeRoot = (ChangeLogDiffNode) commentRoots.get(comment);
+ if (changeRoot == null) {
+ changeRoot = new ChangeLogDiffNode(getRoot(), logEntry);
+ commentRoots.put(comment, changeRoot);
+ }
+ changeRoot.add(infos[i]);
}
- changeRoot.add(infos[i]);
}
return (ChangeLogDiffNode[]) commentRoots.values().toArray(new ChangeLogDiffNode[commentRoots.size()]);
}
- private String getSyncInfoComment(CVSSyncInfo info) {
+ private ILogEntry getSyncInfoComment(CVSSyncInfo info) {
try {
ICVSRemoteResource remote = (ICVSRemoteResource)info.getRemote();
- return remote.getComment();
- } catch (TeamException e) {
- return e.getMessage();
+ if(remote instanceof RemoteFile) {
+ return ((RemoteFile)remote).getLogEntry(new NullProgressMonitor());
+ }
+ return null;
+ } catch (CVSException e) {
+ CVSUIPlugin.getPlugin().log(e);
+ return null;
}
}
diff --git a/bundles/org.eclipse.team.ui/TODO-syncview.txt b/bundles/org.eclipse.team.ui/TODO-syncview.txt
index 3700ff388..3401359fb 100644
--- a/bundles/org.eclipse.team.ui/TODO-syncview.txt
+++ b/bundles/org.eclipse.team.ui/TODO-syncview.txt
@@ -2,11 +2,12 @@
EXAMPLE TEAM UI API USAGES
======================================================================
1. embeding sync viewer in dialog/wizard
-2. added a new content provider (logical views)
+2. added a new content provider (logical views of sync info changes)
3. adding custom label decorations
4. actions/menus
5. fetching sync info set without instantiating a participant
6. fetch and wait for the event collector to finish processing the changes
+7. showing in a diff viewer either a static model (doesn't update when changes occur) or dynamic
======================================================================
PR LIST (07-01-2004)
@@ -103,7 +104,7 @@ x memory and sync set disposal in syncsetcompare input!!!! VERY IMPORTANT!!!
root node can safely always have children.
- several places require a resource
- e.g. conflict propogation requires a resource but shouldn't (modified to work without a resource)
- - conflicts do not propogate in comment view
+ x conflicts do not propogate in comment view [jm] fixed
[jm] we have to change this assumption everywhere! Actions, label decorators... and such.
- there are times when the sync set changes but the input hasn't yet and the given input
doesn't handle outgoing changes. For example, when changing from incoming to outgoing with
@@ -112,4 +113,7 @@ x memory and sync set disposal in syncsetcompare input!!!! VERY IMPORTANT!!!
- the test cases starve the subscriber event handler such that an event has additions and removals for the same resources
- this causes failures in the diff tree builders
- although less likely in UI, can still happen
- - need tests for these scenarios to ensure generated event is correct after addition and removal \ No newline at end of file
+ - need tests for these scenarios to ensure generated event is correct after addition and removal
+- there are several places in SyncInfoSet and in the DiffNodes where we must use the workspace root
+as the input resource to imply get all members? Maybe this should be cleaned up a bit.
+- SyncInfoSet must be cleaned up a lot, the API is vague and method names are not clear. \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoLabelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoLabelProvider.java
index d74c41ee0..5069559e8 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoLabelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/views/SyncInfoLabelProvider.java
@@ -135,6 +135,9 @@ public class SyncInfoLabelProvider extends LabelProvider implements IColorProvid
if(info == null) {
// TODO: How do we decorate parents of conflicts that have no resource
local = TreeViewerUtils.getResource(element);
+ // The reason we still overlay the compare image is to ensure
+ // that the image width for all images shown in the viewer
+ // are consistent.
decoratedImage = getCompareImage(base, SyncInfo.IN_SYNC);
} else {
local = info.getLocal();

Back to the top