Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-02-08 21:13:52 +0000
committerJean Michel-Lemieux2002-02-08 21:13:52 +0000
commit850136ef6b1912158008c330875a493adeda1ea6 (patch)
treeab237c13c8a5b7bbb6894c2ec55f7739264e1afc
parent617aa0f53a745d3b1dfa4f8a0ffd58dec9d782ce (diff)
downloadeclipse.platform.team-850136ef6b1912158008c330875a493adeda1ea6.tar.gz
eclipse.platform.team-850136ef6b1912158008c330875a493adeda1ea6.tar.xz
eclipse.platform.team-850136ef6b1912158008c330875a493adeda1ea6.zip
Customization of the sync granularity in sync compare inputs
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeEditorInput.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncCompareInput.java4
4 files changed, 25 insertions, 4 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
index 42db0813c..16ea4b334 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
@@ -301,7 +301,9 @@ public class CVSRemoteSyncElement extends RemoteSyncElement {
*/
public int getSyncKind(int granularity, IProgressMonitor progress) {
- if(remote instanceof RemoteFile) {
+ int kind = super.getSyncKind(granularity, progress);
+
+ if(remote instanceof RemoteFile && (kind & IRemoteSyncElement.PSEUDO_CONFLICT) == 0) {
int type = ((RemoteFile)remote).getWorkspaceSyncState();
switch(type) {
case Update.STATE_CONFLICT:
@@ -315,6 +317,6 @@ public class CVSRemoteSyncElement extends RemoteSyncElement {
ILocalSyncElement.AUTOMERGE_CONFLICT;
}
}
- return super.getSyncKind(granularity, progress);
+ return kind;
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeEditorInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeEditorInput.java
index 50d13755b..d59030497 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeEditorInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeEditorInput.java
@@ -67,4 +67,13 @@ public class MergeEditorInput extends CVSSyncCompareInput {
}
protected void contentsChanged(ICompareInput source) {
}
-}
+ /*
+ * @see SyncCompareInput#getSyncGranularity()
+ */
+ protected int getSyncGranularity() {
+ // we have to perform content comparison since files in different branches
+ // may have different revisions but the same contents. Consider these files
+ // for merge purposes as equal.
+ return IRemoteSyncElement.GRANULARITY_CONTENTS;
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
index 3047ce57e..3277b0544 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
@@ -99,4 +99,12 @@ public class CVSSyncCompareInput extends SyncCompareInput {
}
}
}
+ /*
+ * @see SyncCompareInput#getSyncGranularity()
+ */
+ protected int getSyncGranularity() {
+ // assuming that sync is always performed relative to the current branch. In
+ // these cases the server will perform the content comparison for us.
+ return IRemoteSyncElement.GRANULARITY_TIMESTAMP;
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncCompareInput.java
index 76b385efb..af5ba7850 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncCompareInput.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncCompareInput.java
@@ -250,7 +250,7 @@ public abstract class SyncCompareInput extends CompareEditorInput {
}
IDiffElement collectResourceChanges(IDiffContainer parent, IRemoteSyncElement tree, IProgressMonitor pm) {
- int type = tree.getSyncKind(IRemoteSyncElement.GRANULARITY_TIMESTAMP, new NullProgressMonitor());
+ int type = tree.getSyncKind(getSyncGranularity(), pm);
MergeResource mergeResource = new MergeResource(tree);
if (tree.isContainer()) {
@@ -271,6 +271,8 @@ public abstract class SyncCompareInput extends CompareEditorInput {
}
}
+ protected abstract int getSyncGranularity();
+
/**
* Builds a DiffFolder tree under the given root for the given resource.
*/

Back to the top