Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-10-05 20:25:18 +0000
committerMichael Valenta2004-10-05 20:25:18 +0000
commit59bf4de210429b5a5e2e866df444be8a1e961a0f (patch)
treeeb9fe46961a4de6422bd4e29dd361b06c608b465
parent828724824b821a040f559a7c05d58cc7e868a973 (diff)
downloadeclipse.platform.team-59bf4de210429b5a5e2e866df444be8a1e961a0f.tar.gz
eclipse.platform.team-59bf4de210429b5a5e2e866df444be8a1e961a0f.tar.xz
eclipse.platform.team-59bf4de210429b5a5e2e866df444be8a1e961a0f.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java91
1 files changed, 72 insertions, 19 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
index 7fd4ca34b..780db5146 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
@@ -11,31 +11,56 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import java.text.DateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.subscribers.*;
import org.eclipse.team.core.subscribers.ChangeSet;
+import org.eclipse.team.core.subscribers.CheckedInChangeSet;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.core.variants.IResourceVariant;
-import org.eclipse.team.internal.ccvs.core.*;
-import org.eclipse.team.internal.ccvs.core.resources.*;
+import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
+import org.eclipse.team.internal.ccvs.core.CVSTag;
+import org.eclipse.team.internal.ccvs.core.ICVSFile;
+import org.eclipse.team.internal.ccvs.core.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
+import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.internal.ccvs.core.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.ILogEntry;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
+import org.eclipse.team.internal.ccvs.core.resources.RemoteResource;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Util;
-import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.HistoryView;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.operations.RemoteLogOperation;
import org.eclipse.team.internal.ccvs.ui.operations.RemoteLogOperation.LogEntryCache;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.ui.synchronize.*;
+import org.eclipse.team.ui.synchronize.ISynchronizeManager;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
+import org.eclipse.team.ui.synchronize.SyncInfoSetChangeSetCollector;
/**
* Collector that fetches the log for incoming CVS change sets
@@ -186,6 +211,25 @@ public class CVSChangeSetCollector extends SyncInfoSetChangeSetCollector {
*/
protected void add(SyncInfo[] infos) {
startUpdateJob(new SyncInfoSet(infos));
+ // Add any outgoing changes to the root set
+ for (int i = 0; i < infos.length; i++) {
+ SyncInfo info = infos[i];
+ if (isOutgoingChange(info)) {
+ addToDefaultSet(info);
+ }
+ }
+ }
+
+ private boolean isOutgoingChange(SyncInfo info) {
+ try {
+ SyncInfo threeWayInfo = CVSProviderPlugin.getPlugin().getCVSWorkspaceSubscriber().getSyncInfo(info.getLocal());
+ if (threeWayInfo == null) return false;
+ int direction = threeWayInfo.getKind() & SyncInfo.DIRECTION_MASK;
+ return (direction == SyncInfo.OUTGOING || direction == SyncInfo.CONFLICTING);
+ } catch (TeamException e) {
+ CVSUIPlugin.log(e);
+ return false;
+ }
}
/* (non-Javadoc)
@@ -551,11 +595,6 @@ public class CVSChangeSetCollector extends SyncInfoSetChangeSetCollector {
*/
private void addRemoteChange(SyncInfo info, ICVSRemoteResource remoteResource, ILogEntry logEntry) {
if(remoteResource != null && logEntry != null && isRemoteChange(info)) {
- ChangeSet set = getChangeSetFor(logEntry);
- if (set == null) {
- set = createChangeSetFor(logEntry);
- add(set);
- }
if(requiresCustomSyncInfo(info, remoteResource, logEntry)) {
info = new CVSUpdatableSyncInfo(info.getKind(), info.getLocal(), info.getBase(), (RemoteResource)logEntry.getRemoteFile(), ((CVSSyncInfo)info).getSubscriber());
try {
@@ -564,19 +603,33 @@ public class CVSChangeSetCollector extends SyncInfoSetChangeSetCollector {
// this shouldn't happen, we've provided our own calculate kind
}
}
- set.add(info);
+ // Only add the info if the base and remote differ
+ IResourceVariant base = info.getBase();
+ IResourceVariant remote = info.getRemote();
+ if ((base == null && remote != null) || (remote == null && base != null) || !base.equals(remote)) {
+ ChangeSet set = getChangeSetFor(logEntry);
+ if (set == null) {
+ set = createChangeSetFor(logEntry);
+ add(set);
+ }
+ set.add(info);
+ }
} else {
// The info was not retrieved for the remote change for some reason.
// Add the node to the root
- ChangeSet set = getDefaultChangeSet();
- if (set == null) {
- set = createDefaultChangeSet();
- add(set);
- }
- set.add(info);
+ addToDefaultSet(info);
}
}
+ private void addToDefaultSet(SyncInfo info) {
+ ChangeSet set = getDefaultChangeSet();
+ if (set == null) {
+ set = createDefaultChangeSet();
+ add(set);
+ }
+ set.add(info);
+ }
+
private ChangeSet getDefaultChangeSet() {
return defaultSet;
}

Back to the top