summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-19 03:00:46 (EDT)
committer Matthias Sohn2011-04-19 03:00:46 (EDT)
commit68823579ee9195cf61db8d9cae9fbd629c7aad19 (patch)
tree054727fc76aeb13c7f443c96ff69491ab82320c0
parentcb29c9daa4347df198495ad8ef2fcc4dcdd4a50a (diff)
downloadegit-68823579ee9195cf61db8d9cae9fbd629c7aad19.zip
egit-68823579ee9195cf61db8d9cae9fbd629c7aad19.tar.gz
egit-68823579ee9195cf61db8d9cae9fbd629c7aad19.tar.bz2
[sync] Filter change sets by configuration mode.refs/changes/60/3160/2
Compare selected mode with change set direction when computing visibility in content provider. Bug: 337394 Change-Id: Ia0b54b15e4989313164e137f10f0e10ae1b14410 Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetContentProvider.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetContentProvider.java
index bda139b..f83655c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetContentProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetContentProvider.java
@@ -11,6 +11,7 @@ package org.eclipse.egit.ui.internal.synchronize.mapping;
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.compare.structuremergeviewer.Differencer;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceMappingContext;
import org.eclipse.core.resources.mapping.ResourceTraversal;
@@ -22,11 +23,13 @@ import org.eclipse.egit.core.synchronize.GitSubscriberMergeContext;
import org.eclipse.egit.core.synchronize.GitSubscriberResourceMappingContext;
import org.eclipse.egit.ui.internal.synchronize.GitChangeSetModelProvider;
import org.eclipse.egit.ui.internal.synchronize.model.GitModelBlob;
+import org.eclipse.egit.ui.internal.synchronize.model.GitModelCommit;
import org.eclipse.egit.ui.internal.synchronize.model.GitModelObjectContainer;
import org.eclipse.egit.ui.internal.synchronize.model.GitModelRoot;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.team.core.mapping.ISynchronizationContext;
import org.eclipse.team.ui.mapping.SynchronizationContentProvider;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.ui.model.WorkbenchContentProvider;
/**
@@ -117,6 +120,17 @@ public class GitChangeSetContentProvider extends SynchronizationContentProvider
}
protected boolean isVisible(ISynchronizationContext context, Object object) {
+ if (object instanceof GitModelCommit) {
+ int kind = ((GitModelCommit) object).getKind();
+ switch (getConfiguration().getMode()) {
+ case ISynchronizePageConfiguration.OUTGOING_MODE:
+ return (kind & Differencer.RIGHT) != 0;
+ case ISynchronizePageConfiguration.INCOMING_MODE:
+ return (kind & Differencer.LEFT) != 0;
+ default:
+ break;
+ }
+ }
return true;
}
}