From 26eb04c78c10f42a794c3a31202fdb7802541715 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Mon, 1 Sep 2003 09:53:05 +0000 Subject: [PATCH] label and lock/unlock cannot be used at the same time in . PR: 22829 Submitted by: Steve Cohen git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275157 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/OptionalTasks/starteam.html | 4 ++-- .../ant/taskdefs/optional/starteam/StarTeamCheckout.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/manual/OptionalTasks/starteam.html b/docs/manual/OptionalTasks/starteam.html index 46244b73b..0e17deaf7 100644 --- a/docs/manual/OptionalTasks/starteam.html +++ b/docs/manual/OptionalTasks/starteam.html @@ -145,7 +145,7 @@ See also the required common StarTeam parameters. label - Check out files as of this label. The label must exist in starteam or an exception will be thrown. If not specified, the most recent version of each file will be checked out. + Check out files as of this label. The label must exist in starteam or an exception will be thrown. If either locked or unlocked is true, an exception will be thrown. If not specified, the most recent version of each file will be checked out. no @@ -163,7 +163,7 @@ that StarTeam is maintaining for the file. If false, status will be used to de locked If true, file will be locked against changes by other users. If false (default) has no effect. - Either or neither, but not both, may be true. + Either or neither, but not both, may be true. Neither may be true if a label is specified. unlocked diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java b/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java index e07f29a15..ea38ea0ad 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java @@ -261,6 +261,11 @@ public class StarTeamCheckout extends TreeBasedTask { Project.MSG_WARN); this.createDirs = false; } + if (lockStatus != Item.LockType.UNCHANGED && null != getLabel()) { + log("Neither locked nor unlocked may be true when checking out a labeled version.", + Project.MSG_ERR); + throw new BuildException("Lock status may not be changed when checking out a non-current version."); + } } /**