Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-09-23 14:18:04 +0000
committerMichael Valenta2004-09-23 14:18:04 +0000
commit273894f8feda56b624c37c245b7339eba7818fbd (patch)
treea75223949eba5c95a6832c776cc9c1d2f4b8cca4
parent4e339813ded295f8b4dd8fcf7954a91765e14798 (diff)
downloadeclipse.platform.team-273894f8feda56b624c37c245b7339eba7818fbd.tar.gz
eclipse.platform.team-273894f8feda56b624c37c245b7339eba7818fbd.tar.xz
eclipse.platform.team-273894f8feda56b624c37c245b7339eba7818fbd.zip
Bug 74770 [Commit Sets] sort comments by is not initialized
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java35
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java14
2 files changed, 41 insertions, 8 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
index f45763227..3da3231b6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java
@@ -12,6 +12,7 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
+
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IFile;
@@ -611,6 +612,15 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
} catch(NumberFormatException e) {
// ignore and use the defaults.
}
+ switch (sortCriteria) {
+ case ChangeLogModelSorter.COMMENT:
+ case ChangeLogModelSorter.DATE:
+ case ChangeLogModelSorter.USER:
+ break;
+ default:
+ sortCriteria = ChangeLogModelSorter.DATE;
+ break;
+ }
}
/* (non-Javadoc)
@@ -1125,17 +1135,16 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
private ICVSRemoteResource getRemoteResource(CVSSyncInfo info) {
try {
ICVSRemoteResource remote = (ICVSRemoteResource) info.getRemote();
- ICVSRemoteResource local = (ICVSRemoteFile) CVSWorkspaceRoot.getRemoteResourceFor(info.getLocal());
+ ICVSRemoteResource local = CVSWorkspaceRoot.getRemoteResourceFor(info.getLocal());
if(local == null) {
local = (ICVSRemoteResource)info.getBase();
}
-
- String remoteRevision = getRevisionString(remote);
- String localRevision = getRevisionString(local);
boolean useRemote = true;
if (local != null && remote != null) {
- useRemote = ResourceSyncInfo.isLaterRevision(remoteRevision, localRevision);
+ String remoteRevision = getRevisionString(remote);
+ String localRevision = getRevisionString(local);
+ useRemote = useRemote(localRevision, remoteRevision);
} else if (remote == null) {
useRemote = false;
}
@@ -1151,7 +1160,21 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
}
}
- private String getRevisionString(ICVSRemoteResource remoteFile) {
+ private boolean useRemote(String localRevision, String remoteRevision) {
+ boolean useRemote;
+ if (remoteRevision == null && localRevision == null) {
+ useRemote = true;
+ } else if (localRevision == null) {
+ useRemote = true;
+ } else if (remoteRevision == null) {
+ useRemote = false;
+ } else {
+ useRemote = ResourceSyncInfo.isLaterRevision(remoteRevision, localRevision);
+ }
+ return useRemote;
+ }
+
+ private String getRevisionString(ICVSRemoteResource remoteFile) {
if(remoteFile instanceof RemoteFile) {
return ((RemoteFile)remoteFile).getRevision();
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
index 3c6a11b43..9d1de1185 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/FlatModelProvider.java
@@ -20,7 +20,8 @@ import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.internal.ui.*;
import org.eclipse.team.ui.TeamImages;
@@ -206,7 +207,16 @@ public class FlatModelProvider extends SynchronizeModelProvider {
}
} catch(NumberFormatException e) {
// ignore and use the defaults.
- }
+ }
+ switch (sortCriteria) {
+ case FlatSorter.PATH:
+ case FlatSorter.NAME:
+ case FlatSorter.PARENT_NAME:
+ break;
+ default:
+ sortCriteria = FlatSorter.PATH;
+ break;
+ }
}
/* (non-Javadoc)

Back to the top