Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-12-02 10:23:21 -0500
committerMichael Valenta2003-12-02 10:23:21 -0500
commit53ab6a73af41314817a5072a5de0798bf9a4a9bc (patch)
tree0e83314a08116b74a407df5faff143c2af6eec7d
parentafd484a589d7088caaf9ced93555bf49370441ae (diff)
downloadeclipse.platform.team-53ab6a73af41314817a5072a5de0798bf9a4a9bc.tar.gz
eclipse.platform.team-53ab6a73af41314817a5072a5de0798bf9a4a9bc.tar.xz
eclipse.platform.team-53ab6a73af41314817a5072a5de0798bf9a4a9bc.zip
47715: silent failure when tagging with existing version tag
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/TagListener.java3
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java21
2 files changed, 23 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/TagListener.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/TagListener.java
index b2cd6f019..8242ab9e6 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/TagListener.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/TagListener.java
@@ -31,8 +31,9 @@ public class TagListener extends CommandOutputListener {
// Received a warning in the form:
// W folder/file : v1 already exists on version 1.2 : NOT MOVING tag to version 1.3
+ // Indicate this as an error since no tagging was done
if( line.charAt(0) == 'W' ) {
- return new CVSStatus(CVSStatus.WARNING, CVSStatus.TAG_ALREADY_EXISTS, commandRoot, line.substring(2));
+ return new CVSStatus(CVSStatus.ERROR, CVSStatus.TAG_ALREADY_EXISTS, commandRoot, line.substring(2));
}
return OK;
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
index a56a510af..efe702dbc 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
@@ -504,5 +504,26 @@ public class CVSProviderTest extends EclipseTest {
} catch(TeamException e) {
}
}
+
+ public void testTagExistsFailure() throws TeamException, CoreException, IOException {
+ IProject project = createProject(new String[] { "a.txt", "b.txt" });
+ CVSTag tag = new CVSTag("v1", CVSTag.VERSION);
+ tagProject(project, tag, false);
+
+ setContentsAndEnsureModified(project.getFile("a.txt"));
+ commitProject(project);
+
+ try {
+ tagProject(project, tag, false/* don't force */);
+ fail("The tag should have failed since the tag already exists.");
+ } catch (TeamException e) {
+ // This is what we expected
+ assertTrue("This exception should be an error", e.getStatus().getSeverity() == IStatus.ERROR);
+ }
+
+ tagProject(project, tag, true /* force */);
+ IProject copy = checkoutCopy(project, tag);
+ assertEquals(project, copy);
+ }
}

Back to the top