Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-05-30 18:02:20 +0000
committerMichael Valenta2002-05-30 18:02:20 +0000
commiteddb5ed75de813164f2340e03fca5d709d7a9a1d (patch)
tree08915b14627b0e4a83e05d1137b8715b111cb246
parent05e89d18d601c51237d3343e44e35ee65b4698ab (diff)
downloadeclipse.platform.team-eddb5ed75de813164f2340e03fca5d709d7a9a1d.tar.gz
eclipse.platform.team-eddb5ed75de813164f2340e03fca5d709d7a9a1d.tar.xz
eclipse.platform.team-eddb5ed75de813164f2340e03fca5d709d7a9a1d.zip
18167: Can't commit changes after replacing with revisionI20020531
-rw-r--r--bundles/org.eclipse.team.cvs.ui/help_contexts.xml18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithRemoteAction.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java14
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties2
6 files changed, 60 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/help_contexts.xml b/bundles/org.eclipse.team.cvs.ui/help_contexts.xml
index 0a8ea7b0a..05a70ece7 100644
--- a/bundles/org.eclipse.team.cvs.ui/help_contexts.xml
+++ b/bundles/org.eclipse.team.cvs.ui/help_contexts.xml
@@ -124,4 +124,22 @@
<description>This view shows the incoming, outgoing and conflicting changes.
</description>
</context>
+ <context id="compare_revisions_view_context" >
+ <description>This view allows the comparision of the local copy of a file with the revisions from the respoitory.
+ Actions availabel of a revision are "Get Contents" and "Get Revision". Although both replace the local file with the contents of the remote rvision, "Get Revision" will make the local file "sticky". This means that changes to the file cannot be committed back to the repository.
+ </description>
+ </context>
+
+ <!-- ********************************** -->
+ <!-- Actions -->
+ <!-- ********************************** -->
+
+ <context id="get_file_revision_action_context" >
+ <description>Load the revision of the file into the workspace. The file will be "sticky" and the user will be unable to commit changes to the repository.
+ </description>
+ </context>
+ <context id="get_file_contents_action_context" >
+ <description>Load the contents of the file into the workspace. The base revision of the local file will not change and the file will become dirty. Perform this action if you wich to revert to the contents of an older revision of the file.
+ </description>
+ </context>
</contexts>
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
index 71ded5a3a..d11a8e717 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareRevisionsInput.java
@@ -64,6 +64,7 @@ import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.actions.CVSAction;
import org.eclipse.team.internal.core.TeamPlugin;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.help.WorkbenchHelp;
public class CVSCompareRevisionsInput extends CompareEditorInput {
IFile resource;
@@ -293,6 +294,12 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
getRevisionAction.setEnabled(ss.size() == 1);
}
});
+
+ // Add F1 help.
+ WorkbenchHelp.setHelp(table, IHelpContextIds.COMPARE_REVISIONS_VIEW);
+ WorkbenchHelp.setHelp(getContentsAction, IHelpContextIds.GET_FILE_CONTENTS_ACTION);
+ WorkbenchHelp.setHelp(getRevisionAction, IHelpContextIds.GET_FILE_REVISION_ACTION);
+
return viewer;
}
/**
@@ -418,7 +425,7 @@ public class CVSCompareRevisionsInput extends CompareEditorInput {
// recompute the labels on the viewer
viewer.refresh();
}
- };
+ };
}
public boolean isSaveNeeded() {
return false;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java
index 2b6900c82..56a6604cc 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java
@@ -68,10 +68,16 @@ public interface IHelpContextIds {
public static final String CONSOLE_VIEW = PREFIX + "console_view_context"; //$NON-NLS-1$
public static final String REPOSITORIES_VIEW = PREFIX + "repositories_view_context"; //$NON-NLS-1$
public static final String RESOURCE_HISTORY_VIEW = PREFIX + "resource_history_view_context"; //$NON-NLS-1$
+ public static final String COMPARE_REVISIONS_VIEW = PREFIX + "compare_revision_view_context"; //$NON-NLS-1$
// Viewers
public static final String CATCHUP_RELEASE_VIEWER = PREFIX + "catchup_release_viewer_context"; //$NON-NLS-1$
// Add to .cvsignor dialog
- public static final String ADD_TO_CVSIGNORE = PREFIX + "add_to_cvsignore_context"; //$NON-NLS-1$
+ public static final String ADD_TO_CVSIGNORE = PREFIX + "add_to_cvsignore_context"; //$NON-NLS-1$
+
+ // Actions
+ public static final String GET_FILE_REVISION_ACTION = PREFIX + "get_file_revision_action_context"; //$NON-NLS-1$
+ public static final String GET_FILE_CONTENTS_ACTION = PREFIX + "get_file_contents_action_context"; //$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 427edfafd..7efcd0a61 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
@@ -6,6 +6,7 @@ package org.eclipse.team.internal.ccvs.ui.actions;
*/
import org.eclipse.compare.CompareUI;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.ErrorDialog;
@@ -13,6 +14,7 @@ import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSTag;
+import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
@@ -78,6 +80,16 @@ public class CompareWithRemoteAction extends CompareWithTagAction {
if(getTag(resource) == null) {
return false;
}
+ // Don't enable if there are sticky file revisions in the lineup
+ if (resources[i].getType() == IResource.FILE) {
+ ICVSFile file = CVSWorkspaceRoot.getCVSFileFor((IFile)resources[i]);
+ ResourceSyncInfo info = file.getSyncInfo();
+ if (info != null && info.getTag() != null) {
+ String revision = info.getRevision();
+ String tag = info.getTag().getName();
+ if (revision.equals(tag)) return false;
+ }
+ }
} catch(CVSException e) {
return false;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java
index 181a0d0c3..46dea2c86 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java
@@ -11,6 +11,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
@@ -19,6 +20,9 @@ import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.internal.ccvs.core.ICVSFile;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ui.IPromptCondition;
import org.eclipse.team.internal.ui.PromptingDialog;
@@ -65,6 +69,16 @@ public class ReplaceWithRemoteAction extends CVSAction {
CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(resources[i].getProject(), CVSProviderPlugin.getTypeId());
if (provider == null) return false;
if (!provider.hasRemote(resources[i])) return false;
+ // Don't enable if there are sticky file revisions in the lineup
+ if (resources[i].getType() == IResource.FILE) {
+ ICVSFile file = CVSWorkspaceRoot.getCVSFileFor((IFile)resources[i]);
+ ResourceSyncInfo info = file.getSyncInfo();
+ if (info != null && info.getTag() != null) {
+ String revision = info.getRevision();
+ String tag = info.getTag().getName();
+ if (revision.equals(tag)) return false;
+ }
+ }
}
return true;
}
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 07c1cf004..702da2315 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
@@ -310,7 +310,7 @@ HistoryFilterDialog.fromDate = &From date (M/D/Y) :
HistoryFilterDialog.toDate = &To date (M/D/Y) :
HistoryView.getContentsAction=&Get Contents
-HistoryView.getRevisionAction=Get &Revision
+HistoryView.getRevisionAction=Get Sticky &Revision
HistoryView.copy=&Copy
HistoryView.revision=Revision
HistoryView.tags=Tags

Back to the top