Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalyan Prasad Tatavarthi2018-08-16 09:29:44 +0000
committerKalyan Prasad Tatavarthi2018-08-16 09:29:44 +0000
commitfe142a75ac3347b04fbf95f615543f4dfc158036 (patch)
tree1b0d5c9231624e4afe65890fd7a48fd4008580a8
parent51157722575c6aef15fc1cd74307c36eedb313ac (diff)
downloadeclipse.platform.team-fe142a75ac3347b04fbf95f615543f4dfc158036.tar.gz
eclipse.platform.team-fe142a75ac3347b04fbf95f615543f4dfc158036.tar.xz
eclipse.platform.team-fe142a75ac3347b04fbf95f615543f4dfc158036.zip
Bug 532617 - Replace headstream instead of branch
Change-Id: Id5354c26cd755ef1735176d2db42a7df663dd787 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.java47
-rw-r--r--bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/pom.xml4
-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
10 files changed, 84 insertions, 19 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 5bdd3a77b..734277bb2 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.4.0.qualifier
+Bundle-Version: 3.4.1.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 0ebbeda45..7ed31b4b6 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, 2015 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.4.0-SNAPSHOT</version>
+ <version>3.4.1-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..3a3d00b83 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
@@ -15,8 +15,7 @@ import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.Socket;
import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
@@ -439,6 +438,48 @@ public class Util {
}
/**
+ * 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 and to the existing tags
+ * 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
* @param resource
* @return
diff --git a/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF
index 7d310e831..9be6f1db6 100644
--- a/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.team.cvs.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.team.cvs.ui; singleton:=true
-Bundle-Version: 3.4.0.qualifier
+Bundle-Version: 3.4.1.qualifier
Bundle-Activator: org.eclipse.team.internal.ccvs.ui.CVSUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.team.cvs.ui/pom.xml b/bundles/org.eclipse.team.cvs.ui/pom.xml
index 762e34c6b..b6ba7242c 100644
--- a/bundles/org.eclipse.team.cvs.ui/pom.xml
+++ b/bundles/org.eclipse.team.cvs.ui/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2015 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.ui</artifactId>
- <version>3.4.0-SNAPSHOT</version>
+ <version>3.4.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
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 a2fd881a4..cae90fdb9 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, 2014 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;
@@ -644,4 +647,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 c9a79db13..a6b811825 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
@@ -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
@@ -23,7 +23,7 @@ public class ReplaceWithRemoteAction extends WorkspaceTraversalAction {
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
- final ReplaceOperation replaceOperation = new ReplaceOperation(getTargetPart(), getCVSResourceMappings(), null);
+ 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..cca2ace8d 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