summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorthallgren2012-03-05 09:36:48 (EST)
committer Matthias Sohn2012-03-05 09:36:48 (EST)
commit309cc0af4e71009a978afbf452411ce84265e270 (patch)
treef76afc8fe1f4e3180d05bdab647eae5e61de2691
parent6ac365c0577dcc2332a074df0653b386ac4b0eb9 (diff)
downloadegit-309cc0af4e71009a978afbf452411ce84265e270.zip
egit-309cc0af4e71009a978afbf452411ce84265e270.tar.gz
egit-309cc0af4e71009a978afbf452411ce84265e270.tar.bz2
Removed dependency to org.eclipse.comparestable-1.3refs/changes/39/5239/2
The org.eclipse.compare bundle introduces dependencies that ripples all the way up to the org.eclipse.ui.ide. The only reason for this dependency was to get some integer constants from the Difference class. This commit replaces those constants with local copies. Change-Id: If21b16de91b12d22796f648ce1d4daaab696ec34 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/AbstractCacheTest.java8
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitCommitsModelCacheTest.java10
-rw-r--r--org.eclipse.egit.core/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitCommitsModelCache.java45
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java2
6 files changed, 47 insertions, 21 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/AbstractCacheTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/AbstractCacheTest.java
index e953fe8..2f1aa47 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/AbstractCacheTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/AbstractCacheTest.java
@@ -8,10 +8,10 @@
*******************************************************************************/
package org.eclipse.egit.core.synchronize;
-import static org.eclipse.compare.structuremergeviewer.Differencer.ADDITION;
-import static org.eclipse.compare.structuremergeviewer.Differencer.CHANGE;
-import static org.eclipse.compare.structuremergeviewer.Differencer.DELETION;
-import static org.eclipse.compare.structuremergeviewer.Differencer.RIGHT;
+import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.ADDITION;
+import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.CHANGE;
+import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.DELETION;
+import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.RIGHT;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertNull;
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitCommitsModelCacheTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitCommitsModelCacheTest.java
index 62c1659..0207899 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitCommitsModelCacheTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitCommitsModelCacheTest.java
@@ -8,11 +8,11 @@
*******************************************************************************/
package org.eclipse.egit.core.synchronize;
-import static org.eclipse.compare.structuremergeviewer.Differencer.ADDITION;
-import static org.eclipse.compare.structuremergeviewer.Differencer.CHANGE;
-import static org.eclipse.compare.structuremergeviewer.Differencer.DELETION;
-import static org.eclipse.compare.structuremergeviewer.Differencer.LEFT;
-import static org.eclipse.compare.structuremergeviewer.Differencer.RIGHT;
+import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.ADDITION;
+import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.CHANGE;
+import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.DELETION;
+import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.LEFT;
+import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.RIGHT;
import static org.eclipse.jgit.junit.JGitTestUtil.deleteTrashFile;
import static org.eclipse.jgit.junit.JGitTestUtil.writeTrashFile;
import static org.eclipse.jgit.lib.ObjectId.zeroId;
diff --git a/org.eclipse.egit.core/META-INF/MANIFEST.MF b/org.eclipse.egit.core/META-INF/MANIFEST.MF
index a77fd61..efc69ba 100644
--- a/org.eclipse.egit.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.egit.core/META-INF/MANIFEST.MF
@@ -8,7 +8,6 @@ Bundle-Vendor: %provider_name
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.team.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.compare;bundle-version="[3.4.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)",
org.eclipse.equinox.security;bundle-version="[1.0.0,2.0.0)"
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitCommitsModelCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitCommitsModelCache.java
index c655ee6..04dd4ac 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitCommitsModelCache.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitCommitsModelCache.java
@@ -8,8 +8,6 @@
*******************************************************************************/
package org.eclipse.egit.core.synchronize;
-import static org.eclipse.compare.structuremergeviewer.Differencer.LEFT;
-import static org.eclipse.compare.structuremergeviewer.Differencer.RIGHT;
import static org.eclipse.jgit.lib.ObjectId.zeroId;
import java.io.IOException;
@@ -19,7 +17,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.eclipse.compare.structuremergeviewer.Differencer;
import org.eclipse.jgit.lib.AbbreviatedObjectId;
import org.eclipse.jgit.lib.MutableObjectId;
import org.eclipse.jgit.lib.ObjectId;
@@ -37,6 +34,36 @@ import org.eclipse.jgit.treewalk.filter.TreeFilter;
public class GitCommitsModelCache {
/**
+ * Constant copied from org.eclipse.compare.structuremergeviewer.Differencer.ADDITION
+ * in order to avoid UI dependencies introduced by the org.eclipse.compare bundle
+ */
+ public static final int ADDITION = 1;
+
+ /**
+ * Constant copied from org.eclipse.compare.structuremergeviewer.Differencer.DELETION
+ * in order to avoid UI dependencies introduced by the org.eclipse.compare bundle
+ */
+ public static final int DELETION = 2;
+
+ /**
+ * Constant copied from org.eclipse.compare.structuremergeviewer.Differencer.CHANGE
+ * in order to avoid UI dependencies introduced by the org.eclipse.compare bundle
+ */
+ public static final int CHANGE = 3;
+
+ /**
+ * Constant copied from org.eclipse.compare.structuremergeviewer.Differencer.LEFT
+ * in order to avoid UI dependencies introduced by the org.eclipse.compare bundle
+ */
+ public static final int LEFT = 4;
+
+ /**
+ * Constant copied from org.eclipse.compare.structuremergeviewer.Differencer.RIGHT
+ * in order to avoid UI dependencies introduced by the org.eclipse.compare bundle
+ */
+ public static final int RIGHT = 8;
+
+ /**
* Corresponds to {@link RevCommit} object, but contains only those data
* that are required by Synchronize view Change Set
*/
@@ -61,8 +88,8 @@ public class GitCommitsModelCache {
/**
* Indicates if this commit is incoming or outgoing. Returned value
- * corresponds to {@link Differencer#LEFT} for incoming and
- * {@link Differencer#RIGHT} for outgoing changes
+ * corresponds to org.eclipse.compare.structuremergeviewer.Differencer#LEFT for incoming and
+ * org.eclipse.compare.structuremergeviewer.Differencer#RIGHT for outgoing changes
*
* @return change direction
*/
@@ -140,7 +167,7 @@ public class GitCommitsModelCache {
* change.
*
* It uses static values of LEFT, RIGHT, ADDITION, DELETION, CHANGE from
- * {@link Differencer} class.
+ * org.eclipse.compare.structuremergeviewer.Differencer class.
*
* @return kind
*/
@@ -332,12 +359,12 @@ public class GitCommitsModelCache {
Change change) {
if (ZERO_ID.equals(change.objectId)) {
change.objectId = null; // clear zero id;
- change.kind = direction | Differencer.DELETION;
+ change.kind = direction | DELETION;
} else if (ZERO_ID.equals(change.remoteObjectId)) {
change.remoteObjectId = null; // clear zero id;
- change.kind = direction | Differencer.ADDITION;
+ change.kind = direction | ADDITION;
} else
- change.kind = direction | Differencer.CHANGE;
+ change.kind = direction | CHANGE;
}
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java
index 9c8cb27..5aa5254 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/StagedChangeCache.java
@@ -8,7 +8,7 @@
*******************************************************************************/
package org.eclipse.egit.core.synchronize;
-import static org.eclipse.compare.structuremergeviewer.Differencer.RIGHT;
+import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.RIGHT;
import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.calculateAndSetChangeKind;
import static org.eclipse.jgit.lib.Constants.HEAD;
import static org.eclipse.jgit.lib.FileMode.MISSING;
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java
index 5bc03a0..45135b1 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/WorkingTreeChangeCache.java
@@ -8,7 +8,7 @@
*******************************************************************************/
package org.eclipse.egit.core.synchronize;
-import static org.eclipse.compare.structuremergeviewer.Differencer.RIGHT;
+import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.RIGHT;
import static org.eclipse.egit.core.synchronize.GitCommitsModelCache.calculateAndSetChangeKind;
import static org.eclipse.jgit.treewalk.filter.TreeFilter.ANY_DIFF;