Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-09-22 19:24:37 +0000
committerMichael Valenta2004-09-22 19:24:37 +0000
commit79da2979bdaf1c800b73ddb7da776495b240fd14 (patch)
treede90518b25f9d3d974f2058331eabe26a2d250ec
parente237550fc4c21db1b1997da938b060d28387c0a3 (diff)
downloadeclipse.platform.team-79da2979bdaf1c800b73ddb7da776495b240fd14.tar.gz
eclipse.platform.team-79da2979bdaf1c800b73ddb7da776495b240fd14.tar.xz
eclipse.platform.team-79da2979bdaf1c800b73ddb7da776495b240fd14.zip
Bug 74670 [Commit Sets] Open Change not enabled for Compare
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ChangeLogModelProvider.java36
1 files changed, 24 insertions, 12 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 4a5319f3e..f45763227 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
@@ -30,8 +30,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.*;
-import org.eclipse.team.core.synchronize.FastSyncInfoFilter.AndSyncInfoFilter;
-import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
+import org.eclipse.team.core.synchronize.FastSyncInfoFilter.*;
import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.resources.*;
@@ -296,8 +295,14 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
return info.getLocal().getType() == IResource.FILE;
}
},
- //TODO: Should be incoming or two-way
- new SyncInfoDirectionFilter(new int[] { SyncInfo.INCOMING, SyncInfo.CONFLICTING })
+ new OrSyncInfoFilter(new FastSyncInfoFilter[] {
+ new SyncInfoDirectionFilter(new int[] { SyncInfo.INCOMING, SyncInfo.CONFLICTING }),
+ new FastSyncInfoFilter() {
+ public boolean select(SyncInfo info) {
+ return !info.getComparator().isThreeWay();
+ }
+ }
+ })
});
}
@@ -745,10 +750,6 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
addSyncInfoToCommentNode(commentInfos[i], logs);
monitor.worked(10);
}
- // Don't cache log entries when in two way mode.
- if (getConfiguration().getComparisonType().equals(ISynchronizePageConfiguration.TWO_WAY)) {
- logs.clearEntries();
- }
}
} finally {
monitor.done();
@@ -763,7 +764,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
*/
private void addSyncInfoToCommentNode(SyncInfo info, LogEntryCache logs) {
ICVSRemoteResource remoteResource = getRemoteResource((CVSSyncInfo)info);
- if(isTagComparison()) {
+ if(isTagComparison() && remoteResource != null) {
addMultipleRevisions(info, logs, remoteResource);
} else {
addSingleRevision(info, logs, remoteResource);
@@ -971,8 +972,7 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
/*
* Return if this sync info should be considered as part of a remote change
* meaning that it can be placed inside an incoming commit set (i.e. the
- * set is determined using the comments from the log entry of the file).
- *
+ * set is determined using the comments from the log entry of the file).
*/
private boolean isRemoteChange(SyncInfo info) {
int kind = info.getKind();
@@ -980,7 +980,16 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
if(info.getComparator().isThreeWay()) {
return (kind & SyncInfo.DIRECTION_MASK) != SyncInfo.OUTGOING;
}
- return true;
+ // For two-way, the change is only remote if it has a remote or has a base locally
+ if (info.getRemote() != null) return true;
+ ICVSFile file = CVSWorkspaceRoot.getCVSFileFor((IFile)info.getLocal());
+ try {
+ return file.getSyncBytes() != null;
+ } catch (CVSException e) {
+ // Log the error and exclude the file from consideration
+ CVSUIPlugin.log(e);
+ return false;
+ }
}
/*
@@ -1157,6 +1166,9 @@ public class ChangeLogModelProvider extends CompositeModelProvider implements IC
if(fetchLogEntriesJob != null && fetchLogEntriesJob.getState() != Job.NONE) {
fetchLogEntriesJob.cancel();
}
+ if (logs != null) {
+ logs.clearEntries();
+ }
CommitSetManager.getInstance().removeListener(this);
super.dispose();
}

Back to the top