Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-05-01 17:33:11 +0000
committerjames2002-05-01 17:33:11 +0000
commitd4283f80ac9394ec1d9e9a7a51db04786a768890 (patch)
treeaf2db4853f53f6df0209f39b9edd48b1c95cda23
parent4177a36b05559324c5114fc0f9a130e3aec8181b (diff)
downloadeclipse.platform.team-d4283f80ac9394ec1d9e9a7a51db04786a768890.tar.gz
eclipse.platform.team-d4283f80ac9394ec1d9e9a7a51db04786a768890.tar.xz
eclipse.platform.team-d4283f80ac9394ec1d9e9a7a51db04786a768890.zip
Toggle granularity in editors and sync view
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/sync/RemoteSyncElement.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/icons/full/ctool16/contents.gifbin0 -> 152 bytes
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.properties3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLocalCompareEditorInput.java22
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ContentAction.java64
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeEditorInput.java15
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java20
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/CatchupReleaseViewer.java13
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncCompareInput.java21
15 files changed, 157 insertions, 45 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/sync/RemoteSyncElement.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/sync/RemoteSyncElement.java
index ac2667b43..60289a589 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/sync/RemoteSyncElement.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/sync/RemoteSyncElement.java
@@ -180,7 +180,8 @@ public abstract class RemoteSyncElement extends LocalSyncElement implements IRem
description = CONFLICTING | ADDITION;
try {
progress.beginTask(null, 60);
- if (compare(granularity, true, local, remote, Policy.subMonitorFor(progress, 30))) {
+ if (granularity == RemoteSyncElement.GRANULARITY_CONTENTS &&
+ compare(granularity, true, local, remote, Policy.subMonitorFor(progress, 30))) {
description |= PSEUDO_CONFLICT;
}
} finally {
@@ -217,7 +218,9 @@ public abstract class RemoteSyncElement extends LocalSyncElement implements IRem
} else {
description = CONFLICTING | CHANGE;
}
- if (description != IN_SYNC && compare(granularity, true, local, remote, Policy.subMonitorFor(progress, 30))) {
+ if (description != IN_SYNC &&
+ granularity == RemoteSyncElement.GRANULARITY_CONTENTS &&
+ compare(granularity, true, local, remote, Policy.subMonitorFor(progress, 30))) {
description |= PSEUDO_CONFLICT;
}
progress.done();
diff --git a/bundles/org.eclipse.team.cvs.ui/icons/full/ctool16/contents.gif b/bundles/org.eclipse.team.cvs.ui/icons/full/ctool16/contents.gif
new file mode 100644
index 000000000..6b86d0797
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/icons/full/ctool16/contents.gif
Binary files differ
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.properties b/bundles/org.eclipse.team.cvs.ui/plugin.properties
index 895a9a6d0..075f9fb6d 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.properties
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.properties
@@ -37,6 +37,9 @@ CompareWithRevisionAction.tooltip=Compare with Revision on CVS Server
CompareWithTagAction.label=&Branch or Version...
CompareWithTagAction.tooltip=Compare with a Branch or a Version on the CVS Server
+ContentAction.label=Compare File Contents
+ContentAction.tooltip=Use File Contents Instead of Timestamps When Comparing
+
CopyRepositoryNameAction.label=&Copy to Clipboard
CopyRepositoryNameAction.tooltip=Copy Repository Names to Clipboard
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index d46111fd4..a69d72038 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -552,4 +552,22 @@
<extension point="org.eclipse.team.core.projectSets">
<projectSet id="org.eclipse.team.cvs.core.cvsnature" class="org.eclipse.team.internal.ccvs.ui.CVSProjectSetSerializer"/>
</extension>
+
+
+ <!-- ************ Editor Actions ************** -->
+ <extension point="org.eclipse.ui.editorActions">
+ <editorContribution
+ id="org.eclipse.team.cvs.ui.contentCompare"
+ targetID="org.eclipse.compare.CompareEditor">
+ <action
+ id="org.eclipse.team.cvs.ui.ContentAction"
+ state="false"
+ toolbarPath="additions"
+ icon="icons/full/ctool16/contents.gif"
+ label="%ContentAction.label"
+ tooltip="%ContentAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ContentAction">
+ </action>
+ </editorContribution>
+ </extension>
</plugin>
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLocalCompareEditorInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLocalCompareEditorInput.java
index 7f644d48e..37a87693f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLocalCompareEditorInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLocalCompareEditorInput.java
@@ -24,13 +24,19 @@ public class CVSLocalCompareEditorInput extends CVSSyncCompareInput {
CVSTag[] tags;
public CVSLocalCompareEditorInput(IResource[] resources, CVSTag[] tags) {
- super(resources);
+ // 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.
+ super(resources, IRemoteSyncElement.GRANULARITY_CONTENTS);
Assert.isTrue(resources.length == tags.length);
this.tags = tags;
}
public CVSLocalCompareEditorInput(IResource[] resources, CVSTag tag) {
- super(resources);
+ // 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.
+ super(resources, IRemoteSyncElement.GRANULARITY_CONTENTS);
Assert.isTrue(tag != null);
this.tags = new CVSTag[] {tag};
}
@@ -66,7 +72,7 @@ public class CVSLocalCompareEditorInput extends CVSSyncCompareInput {
}
public String getTitle() {
- return "CVS Compare [" + tags[0].getName() +"]";
+ return Policy.bind("CVSLocalCompareEditorInput.title", tags[0].getName()); //$NON-NLS-1$
}
public boolean isSaveNeeded() {
@@ -75,14 +81,4 @@ public class CVSLocalCompareEditorInput 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/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index 0f4208f79..ee2551aaf 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -246,6 +246,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
store.setDefault(ICVSUIConstants.PREF_REPLACE_UNMANAGED, true);
store.setDefault(ICVSUIConstants.PREF_CVS_RSH, CVSProviderPlugin.DEFAULT_CVS_RSH);
store.setDefault(ICVSUIConstants.PREF_CVS_SERVER, CVSProviderPlugin.DEFAULT_CVS_SERVER);
+ store.setDefault(ICVSUIConstants.PREF_PROMPT_ON_CHANGE_GRANULARITY, true);
PreferenceConverter.setDefault(store, ICVSUIConstants.PREF_CONSOLE_COMMAND_COLOR, new RGB(0, 0, 0));
PreferenceConverter.setDefault(store, ICVSUIConstants.PREF_CONSOLE_MESSAGE_COLOR, new RGB(0, 0, 255));
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
index da7dfe83a..28ba97319 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
@@ -56,7 +56,8 @@ public interface ICVSUIConstants {
public final String PREF_TEXT_KSUBST = "pref_text_ksubst"; //$NON-NLS-1$
public final String PREF_PROMPT_ON_MIXED_TAGS = "pref_prompt_on_mixed_tags"; //$NON-NLS-1$
public final String PREF_PROMPT_ON_SAVING_IN_SYNC = "pref_prompt_on_saving_in_sync"; //$NON-NLS-1$
-
+ public final String PREF_PROMPT_ON_CHANGE_GRANULARITY = "pref_prompt_on_change_granularity"; //$NON-NLS-1$
+
// console preferences
public final String PREF_CONSOLE_COMMAND_COLOR = "pref_console_command_color"; //$NON-NLS-1$
public final String PREF_CONSOLE_MESSAGE_COLOR = "pref_console_message_color"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
index 9ef0a0018..1a3149117 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java
@@ -33,8 +33,8 @@ public class CompareWithRemoteAction extends CompareWithTagAction {
}
CompareUI.openCompareEditor(new CVSLocalCompareEditorInput(resources, tags));
} catch(CVSException e) {
- ErrorDialog.openError(getShell(), Policy.bind("CompareWithRemoteAction.compare"),
- Policy.bind("CompareWithRemoteAction.noRemoteLong"), e.getStatus());
+ ErrorDialog.openError(getShell(), Policy.bind("CompareWithRemoteAction.compare"), //$NON-NLS-1$
+ Policy.bind("CompareWithRemoteAction.noRemoteLong"), e.getStatus()); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ContentAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ContentAction.java
new file mode 100644
index 000000000..7f0126cec
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ContentAction.java
@@ -0,0 +1,64 @@
+package org.eclipse.team.internal.ccvs.ui.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.core.sync.ILocalSyncElement;
+import org.eclipse.team.internal.ccvs.ui.AvoidableMessageDialog;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
+import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.sync.CVSSyncCompareInput;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.actions.ActionDelegate;
+
+public class ContentAction extends ActionDelegate implements IEditorActionDelegate {
+ CVSSyncCompareInput syncInput;
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ final IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
+ if (store.getBoolean(ICVSUIConstants.PREF_PROMPT_ON_CHANGE_GRANULARITY)) {
+ Shell shell = syncInput.getViewer().getControl().getShell();
+ AvoidableMessageDialog dialog = new AvoidableMessageDialog(
+ shell,
+ Policy.bind("ContentAction.Confirm_Long_Operation_1"), //$NON-NLS-1$
+ null, // accept the default window icon
+ Policy.bind("ContentAction.Changing_this_setting_will_involve_contacting_the_server_and_may_be_long-running_2"), //$NON-NLS-1$
+ MessageDialog.QUESTION,
+ new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL},
+ 0);
+
+ boolean result = dialog.open() == 0;
+ if (result && dialog.isDontShowAgain()) {
+ store.setValue(ICVSUIConstants.PREF_PROMPT_ON_CHANGE_GRANULARITY, false);
+ }
+ if (!result) return;
+ }
+ syncInput.setSyncGranularity(action.isChecked() ? ILocalSyncElement.GRANULARITY_CONTENTS : ILocalSyncElement.GRANULARITY_TIMESTAMP);
+ }
+
+ /**
+ * @see IEditorActionDelegate#setActiveEditor(IAction, IEditorPart)
+ */
+ public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+ if (targetEditor != null) {
+ IEditorInput input = targetEditor.getEditorInput();
+ if (input instanceof CVSSyncCompareInput) {
+ this.syncInput = (CVSSyncCompareInput)input;
+ action.setEnabled(true);
+ action.setChecked(syncInput.getSyncGranularity() == ILocalSyncElement.GRANULARITY_CONTENTS);
+ return;
+ }
+ }
+ syncInput = null;
+ action.setEnabled(false);
+ }
+
+}
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 f7a1ddf2c..4d976c4fd 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
@@ -35,7 +35,10 @@ public class MergeEditorInput extends CVSSyncCompareInput {
CVSTag end;
public MergeEditorInput(IResource[] resources, CVSTag start, CVSTag end) {
- super(resources);
+ // 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.
+ super(resources, IRemoteSyncElement.GRANULARITY_CONTENTS);
this.start = start;
this.end = end;
}
@@ -75,16 +78,6 @@ 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;
- }
-
/**
* Wrap the input preparation in a CVS session run so open sessions will be reused
*/
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index 81d5f62ee..f91abec4b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -126,6 +126,8 @@ CVSFolderPropertiesPage.root=Repository Root:
CVSFolderPropertiesPage.repository=Repository Path:
CVSFolderPropertiesPage.static=Static:
+CVSLocalCompareEditorInput.title=CVS Compare [{0}]
+
CVSMoveDeleteHook.deleteFileTitle=Deletion of CVS Controlled File
CVSMoveDeleteHook.deleteFileMessage=File ''{0}'' is under CVS control. In order to properly communicate the deletion to CVS, this file will be marked as an outgoing deletion.
CVSMoveDeleteHook.moveFileTitle=Move of CVS Controlled File
@@ -161,8 +163,8 @@ CVSPreferencePage.silentWarningTitle="Very Quiet" mode is dangerous
CVSPreferencePage.silentWarningMessage= In "Very Quiet" mode, some cvs servers may not communicate important information about errors that have occured. You may want to consider using "Somewhat quiet" mode instead.
CVSPreferencePage.showModules=&Show modules from CVSROOT/modules in repository view
CVSPreferencePage.historyTracksSelection=Link &History view to current selection
-CVSPreferencePage.considerContentsInCompare=&Compare file contents when comparing CVS files that have different revision numbers.
-CVSPreferencePage.considerContentsInCompareTooltip=The fastest method of comparing CVS files is to consider two files with the same\nrevision number as equal. However, in some cases like when using branches, a more\naccurate comparison can be achieved by comparing the content of files with\ndifferent revision numbers.
+CVSPreferencePage.considerContentsInCompare=&Consider file contents instead of timestamp information when comparing CVS files
+CVSPreferencePage.considerContentsInCompareTooltip=The fastest method of comparing CVS files is to consider the timestamps.\nHowever, in some cases a more accurate comparison can be achieved\nby comparing the content of files. This setting applies to all\nCVS compare editors and the Synchronize view.
CVSPreferencePage.promptOnFileDelete=&Prompt for confirmation on deletion of managed files
CVSPreferencePage.promptOnFileDeleteTooltip=Deletion of managed files results in an outgoing deletion that will be sent to the \nserver on the next commit. The user can choose to be prompted for confirmation \non the deletion of managed files.
CVSPreferencePage.promptOnFolderDelete=Prompt for confirmation on deletion of managed &folders
@@ -691,3 +693,5 @@ CVSRepositoryPropertiesPage.There_are_projects_in_the_workspace_shared_with_this
CVSProjectSetSerializer.Confirm_Overwrite_Project_8=Confirm Overwrite Project
CVSProjectSetSerializer.The_project_{0}_already_exists._Do_you_wish_to_overwrite_it__9=The project {0} already exists. Do you wish to overwrite it?
+ContentAction.Confirm_Long_Operation_1=Confirm Long Operation
+ContentAction.Changing_this_setting_will_involve_contacting_the_server_and_may_be_long-running_2=Changing this setting will involve contacting the server and may be long-running
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 ebb1cb295..37ae016bd 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
@@ -16,6 +16,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.sync.ILocalSyncElement;
import org.eclipse.team.core.sync.IRemoteSyncElement;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.resources.CVSRemoteSyncElement;
@@ -32,14 +33,20 @@ import org.eclipse.team.ui.sync.TeamFile;
public class CVSSyncCompareInput extends SyncCompareInput {
private IResource[] resources;
private TeamFile previousTeamFile = null;
-
+
/**
* Creates a new catchup or release operation.
*/
public CVSSyncCompareInput(IResource[] resources) {
- super();
+ super(CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.PREF_CONSIDER_CONTENTS) ? ILocalSyncElement.GRANULARITY_CONTENTS : ILocalSyncElement.GRANULARITY_TIMESTAMP);
+ this.resources = resources;
+ }
+
+ protected CVSSyncCompareInput(IResource[] resources, int granularity) {
+ super(granularity);
this.resources = resources;
}
+
/**
* Overridden to create a custom DiffTreeViewer in the top left pane of the CompareProvider.
*
@@ -153,15 +160,6 @@ 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;
- }
-
- /*
* Helper method to get cvs elements from the selection in the sync editor input
*/
public static CVSRemoteSyncElement getSyncElementFrom(Object node) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
index fd732f15a..e38143f69 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
@@ -11,6 +11,8 @@ CatchupReleaseViewer.showOnlyConflictsAction=Show Only Conflicts
CatchupReleaseViewer.showOutgoingAction=Show Outgoing
CatchupReleaseViewer.removeFromView=Remove &From View
CatchupReleaseViewer.copyAllRightToLeft=Copy &All Changes From Right To Left
+CatchupReleaseViewer.Compare_File_Contents_1=Compare File Contents
+CatchupReleaseViewer.Copying_right_contents_into_workspace_2=Copying right contents into workspace
CheckInAction.checkin=Check In
CheckInAction.checkingIn=Checking In...
@@ -84,6 +86,7 @@ SyncView.errorSaving=Error while saving modified resources
TeamAction.internal=Internal error occured.
TeamFile.saveChanges=Unable to save changes to file: {0}
+TeamFile.modified=<{0}>
TextPreferencePage.add=&Add...
TextPreferencePage.binary=Binary
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/CatchupReleaseViewer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/CatchupReleaseViewer.java
index 25244c23a..12c830125 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/CatchupReleaseViewer.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/CatchupReleaseViewer.java
@@ -46,6 +46,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Tree;
+import org.eclipse.team.core.sync.ILocalSyncElement;
import org.eclipse.team.core.sync.IRemoteSyncElement;
import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.internal.ui.UIConstants;
@@ -164,6 +165,7 @@ public abstract class CatchupReleaseViewer extends DiffTreeViewer implements ISe
private Action removeFromTree;
private ShowInNavigatorAction showInNavigator;
private Action ignoreWhiteSpace;
+ private Action toggleGranularity;
// Property constant for diff mode kind
static final String PROP_KIND = "team.ui.PropKind"; //$NON-NLS-1$
@@ -194,6 +196,7 @@ public abstract class CatchupReleaseViewer extends DiffTreeViewer implements ISe
menu.add(showIncoming);
menu.add(showOutgoing);
}
+ menu.add(toggleGranularity);
menu.add(ignoreWhiteSpace);
menu.add(refresh);
}
@@ -272,6 +275,14 @@ public abstract class CatchupReleaseViewer extends DiffTreeViewer implements ISe
}
};
+ // Toggle granularity
+ toggleGranularity = new Action(Policy.bind("CatchupReleaseViewer.Compare_File_Contents_1")) { //$NON-NLS-1$
+ public void run() {
+ diffModel.setSyncGranularity(isChecked() ? ILocalSyncElement.GRANULARITY_CONTENTS : ILocalSyncElement.GRANULARITY_TIMESTAMP);
+ }
+ };
+ toggleGranularity.setChecked(false);
+
removeFromTree = new Action(Policy.bind("CatchupReleaseViewer.removeFromView"), null) { //$NON-NLS-1$
public void run() {
ISelection s = getSelection();
@@ -304,7 +315,7 @@ public abstract class CatchupReleaseViewer extends DiffTreeViewer implements ISe
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
try {
- monitor.beginTask("Copying right contents into workspace", 100);
+ monitor.beginTask(Policy.bind("CatchupReleaseViewer.Copying_right_contents_into_workspace_2"), 100); //$NON-NLS-1$
copyAllRightToLeft((DiffElement)element, Policy.subMonitorFor(monitor, 100));
} finally {
monitor.done();
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 e7412fcdb..aff8ab516 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
@@ -57,6 +57,7 @@ public abstract class SyncCompareInput extends CompareEditorInput {
private DiffNode diffRoot;
private Shell shell;
private IViewSite viewSite;
+ private int granularity;
private ICompareInputChangeListener listener = new ICompareInputChangeListener() {
public void compareInputChanged(ICompareInput source) {
@@ -75,10 +76,18 @@ public abstract class SyncCompareInput extends CompareEditorInput {
/**
* Creates a new catchup or release operation.
*/
- public SyncCompareInput() {
+ public SyncCompareInput(int granularity) {
super(new CompareConfiguration());
+ this.granularity = granularity;
}
+ /**
+ * Creates a new catchup or release operation.
+ */
+ public SyncCompareInput() {
+ this(ILocalSyncElement.GRANULARITY_TIMESTAMP);
+ }
+
protected abstract IRemoteSyncElement[] createSyncElements(IProgressMonitor monitor) throws TeamException;
/*
@@ -276,7 +285,15 @@ public abstract class SyncCompareInput extends CompareEditorInput {
}
}
- protected abstract int getSyncGranularity();
+ public int getSyncGranularity() {
+ return granularity;
+ }
+
+ public void setSyncGranularity(int granularity) {
+ this.granularity = granularity;
+ refresh();
+ }
+
/**
* Builds a DiffFolder tree under the given root for the given resource.

Back to the top