Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalyan Prasad Tatavarthi2018-06-27 06:29:28 -0400
committerKalyan Prasad Tatavarthi2018-07-11 07:43:44 -0400
commit65a2bb9a9658311cd147551006a1cc4b25529a32 (patch)
treeff05623b81ec274e36a307f3e5593d37e97c7ff2
parentdd92c3cc97f2c3dbb995c967b70c7b3a3739e323 (diff)
downloadeclipse.platform.team-R4_4_maintenance.tar.gz
eclipse.platform.team-R4_4_maintenance.tar.xz
eclipse.platform.team-R4_4_maintenance.zip
Bug 532617 - Replace headstream instead of branchR4_4_maintenance
Change-Id: I9f87b73bf9343a7bcad86449c07024fe06083eee Signed-off-by: Kalyan Prasad Tatavarthi <kalyan_prasad@in.ibm.com>
-rw-r--r--bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.team.cvs.core/pom.xml4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java45
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java19
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ReplaceWithRemoteAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java5
8 files changed, 80 insertions, 15 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
index 2f2fa0b1d..ac0319830 100644
--- a/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.cvs.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.cvs.core; singleton:=true
-Bundle-Version: 3.3.600.qualifier
+Bundle-Version: 3.3.601.qualifier
Bundle-Activator: org.eclipse.team.internal.ccvs.core.CVSProviderPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.team.cvs.core/pom.xml b/bundles/org.eclipse.team.cvs.core/pom.xml
index d0273d24e..c0fd82987 100644
--- a/bundles/org.eclipse.team.cvs.core/pom.xml
+++ b/bundles/org.eclipse.team.cvs.core/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2013 Eclipse Foundation and others.
+ Copyright (c) 2012, 2018 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.team</groupId>
<artifactId>org.eclipse.team.cvs.core</artifactId>
- <version>3.3.600-SNAPSHOT</version>
+ <version>3.3.601-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java
index 937df4d1d..4a026aed0 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/Util.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@ import java.io.InterruptedIOException;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.eclipse.core.resources.*;
@@ -437,6 +438,48 @@ public class Util {
return tag;
}
+
+ /**
+ * Workaround for CVS "bug" where CVS ENTRIES file does not contain correct
+ * Branch vs. Version info. Entries files always record a Tv1 so all entries would
+ * appear as branches.
+ *
+ * By comparing the revision number to the tag name
+ * you can determine if the tag is a branch or version.
+ *
+ * @param cvsResource the resource to test. Must nut be null.
+ * @return the correct cVSTag. May be null.
+ */
+ public static CVSTag getAccurateFileTag(ICVSResource cvsResource, CVSTag[] existing) throws CVSException {
+ List tags= Arrays.asList(existing);
+ CVSTag tag = null;
+ ResourceSyncInfo info = cvsResource.getSyncInfo();
+ if(info != null) {
+ tag = info.getTag();
+ }
+
+ FolderSyncInfo parentInfo = cvsResource.getParent().getFolderSyncInfo();
+ CVSTag parentTag = null;
+ if(parentInfo != null) {
+ parentTag = parentInfo.getTag();
+ }
+
+ if(tag != null) {
+ if(tag.getName().equals(info.getRevision())) {
+ tag = new CVSTag(tag.getName(), CVSTag.VERSION);
+ } else if(parentTag != null){
+ tag = new CVSTag(tag.getName(), parentTag.getType());
+ } else if (!tags.contains(tag)) {
+ if (!tags.contains(tag)) {
+ CVSTag newTag= new CVSTag(tag.getName(), CVSTag.VERSION);
+ if (tags.contains(newTag)) {
+ tag = newTag;
+ }
+ }
+ }
+ }
+ return tag;
+ }
/**
* Return the fullest path that we can obtain for the given resource
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java
index c7d18d8b6..f448349b5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSFilePropertiesPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,7 +25,7 @@ import org.eclipse.team.internal.ccvs.core.CVSTag;
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.core.util.Util;
+import org.eclipse.team.internal.ccvs.ui.actions.CVSAction;
import org.eclipse.ui.PlatformUI;
import com.ibm.icu.text.DateFormat;
@@ -83,7 +83,7 @@ public class CVSFilePropertiesPage extends CVSPropertiesPage {
// Tag
createLabel(composite, CVSUIMessages.CVSFilePropertiesPage_tag);
- CVSTag tag = Util.getAccurateFileTag(cvsResource);
+ CVSTag tag = CVSAction.getAccurateFileTag(cvsResource);
createReadOnlyText(composite, getTagLabel(tag));
} catch (TeamException e) {
// Display error text
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
index 12924b7bb..49df0194f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,8 +33,11 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.filehistory.CVSFileRevision;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.core.util.Util;
import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
+import org.eclipse.team.internal.ccvs.ui.tags.TagSource;
+import org.eclipse.team.internal.ccvs.ui.tags.TagSourceWorkbenchAdapter;
import org.eclipse.team.internal.ui.*;
import org.eclipse.team.internal.ui.actions.TeamAction;
import org.eclipse.team.internal.ui.dialogs.IPromptCondition;
@@ -643,4 +646,18 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg
}
return props.getCVSResourceFor(resource);
}
+
+ public static CVSTag getAccurateFileTag(ICVSResource cvsResource) throws CVSException {
+ CVSTag tag = null;
+ if (cvsResource != null) {
+ return Util.getAccurateFileTag(cvsResource, getTags(cvsResource));
+ }
+ return tag;
+ }
+
+ public static CVSTag[] getTags(ICVSResource cvsResource) {
+ TagSource tagSource= TagSource.create(new ICVSResource[] { cvsResource });
+ return tagSource.getTags(TagSource.convertIncludeFlaqsToTagTypes(TagSourceWorkbenchAdapter.INCLUDE_ALL_TAGS));
+
+ }
}
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 a540f3b35..99c1c8864 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
@@ -15,7 +15,6 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.ui.CVSUIMessages;
import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation;
@@ -23,8 +22,7 @@ import org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation;
public class ReplaceWithRemoteAction extends WorkspaceTraversalAction {
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
- // Using CVSTag.BASE similar to ReplaceWithLatestRevisionAction
- final ReplaceOperation replaceOperation = new ReplaceOperation(getTargetPart(), getCVSResourceMappings(), CVSTag.BASE);
+ final ReplaceOperation replaceOperation = new ReplaceOperation(getTargetPart(), getCVSResourceMappings(), resourceCommonTag);
if (hasOutgoingChanges(replaceOperation)) {
final boolean[] keepGoing = new boolean[] { true };
Display.getDefault().syncExec(new Runnable() {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
index 2b538d3e1..3f9b6eae1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -45,6 +45,8 @@ import org.eclipse.team.internal.ui.dialogs.PromptingDialog;
*/
public abstract class WorkspaceAction extends CVSAction {
+ protected CVSTag resourceCommonTag = null;
+
public interface IProviderAction {
public IStatus execute(CVSTeamProvider provider, IResource[] resources, IProgressMonitor monitor) throws CVSException;
}
@@ -459,6 +461,7 @@ public abstract class WorkspaceAction extends CVSAction {
*/
protected String calculateActionTagValue() {
try {
+ resourceCommonTag = null;
IResource[] resources = getSelectedResources();
CVSTag commonTag = null;
boolean sameTagType = true;
@@ -476,7 +479,7 @@ public abstract class WorkspaceAction extends CVSAction {
tag = Util.getAccurateFolderTag(resources[i], tag);
}
} else {
- tag = Util.getAccurateFileTag(cvsResource);
+ tag = CVSAction.getAccurateFileTag(cvsResource);
}
if(tag == null) {
tag = new CVSTag();
@@ -498,6 +501,9 @@ public abstract class WorkspaceAction extends CVSAction {
if(commonTag != null) {
int tagType = commonTag.getType();
String tagName = commonTag.getName();
+ if(tagType != CVSTag.HEAD) {
+ resourceCommonTag = commonTag;
+ }
// multiple tag names but of the same type
if(sameTagType && !multipleSameNames) {
if(tagType == CVSTag.BRANCH) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java
index ff7d93bb2..cc676af83 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,6 +31,7 @@ import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.Util;
import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.actions.CVSAction;
import org.eclipse.team.internal.ccvs.ui.mappings.ModelCompareParticipant;
import org.eclipse.team.internal.ccvs.ui.operations.RemoteLogOperation;
import org.eclipse.team.internal.ccvs.ui.operations.RemoteLogOperation.LogEntryCache;
@@ -604,7 +605,7 @@ public class LogEntryCacheUpdateHandler extends BackgroundEventHandler {
tag = Util.getAccurateFolderTag(local, tag);
}
} else {
- tag = Util.getAccurateFileTag(cvsResource);
+ tag = CVSAction.getAccurateFileTag(cvsResource);
}
if(tag == null) {
tag = new CVSTag();

Back to the top