Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalyan Prasad Tatavarthi2018-08-14 07:10:20 -0400
committerKalyan Prasad Tatavarthi2018-08-16 02:56:12 -0400
commitea5a672765f025df815a6065bfdee44d167739e2 (patch)
tree791961948187619680c81214aea4dd98f52030a0
parent5e4727436bcdb4d509cb39aff99949886efa3b4c (diff)
downloadeclipse.platform.team-R4_8_maintenance.tar.gz
eclipse.platform.team-R4_8_maintenance.tar.xz
eclipse.platform.team-R4_8_maintenance.zip
Bug 532617 - Replace headstream instead of branchR4_8_maintenance
Change-Id: I22923196a7337aafbd935f6ab924855c67fabdf9 Signed-off-by: Kalyan Prasad Tatavarthi <kalyan_prasad@in.ibm.com>
-rw-r--r--bundles/org.eclipse.cvs/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.cvs/pom.xml4
-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.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/LogEntryCacheUpdateHandler.java5
-rw-r--r--features/org.eclipse.cvs-feature/feature.xml2
-rw-r--r--features/org.eclipse.cvs-feature/pom.xml4
14 files changed, 89 insertions, 24 deletions
diff --git a/bundles/org.eclipse.cvs/META-INF/MANIFEST.MF b/bundles/org.eclipse.cvs/META-INF/MANIFEST.MF
index efe9ebbac..d257dbc51 100644
--- a/bundles/org.eclipse.cvs/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.cvs/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cvs; singleton:=true
-Bundle-Version: 1.4.500.qualifier
+Bundle-Version: 1.4.501.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.cvs/pom.xml b/bundles/org.eclipse.cvs/pom.xml
index 1e215475f..85e5215cd 100644
--- a/bundles/org.eclipse.cvs/pom.xml
+++ b/bundles/org.eclipse.cvs/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2017 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,7 +19,7 @@
</parent>
<groupId>org.eclipse.cvs</groupId>
<artifactId>org.eclipse.cvs</artifactId>
- <version>1.4.500-SNAPSHOT</version>
+ <version>1.4.501-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
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 7c226705c..fadc1b235 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.200.qualifier
+Bundle-Version: 3.4.201.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 d37aac869..bb78b097d 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, 2016 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.200-SNAPSHOT</version>
+ <version>3.4.201-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 5877963a8..f31adda8b 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.100.qualifier
+Bundle-Version: 3.4.101.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 920feca04..22f764e14 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, 2017 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.100-SNAPSHOT</version>
+ <version>3.4.101-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 cf614fbcb..0c322a791 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
@@ -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();
diff --git a/features/org.eclipse.cvs-feature/feature.xml b/features/org.eclipse.cvs-feature/feature.xml
index 77979413a..541274077 100644
--- a/features/org.eclipse.cvs-feature/feature.xml
+++ b/features/org.eclipse.cvs-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.cvs"
label="%featureName"
- version="1.4.500.qualifier"
+ version="1.4.501.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/features/org.eclipse.cvs-feature/pom.xml b/features/org.eclipse.cvs-feature/pom.xml
index 14c7eb6b8..b7c5e9252 100644
--- a/features/org.eclipse.cvs-feature/pom.xml
+++ b/features/org.eclipse.cvs-feature/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2017 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,7 +19,7 @@
</parent>
<groupId>org.eclipse.cvs.feature</groupId>
<artifactId>org.eclipse.cvs</artifactId>
- <version>1.4.500-SNAPSHOT</version>
+ <version>1.4.501-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<build>

Back to the top