diff --git a/WHATSNEW b/WHATSNEW index 064ade6c6..d0f41b60d 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -395,6 +395,9 @@ Bugzilla Report 19180. if ejbjar has cmpversion="2.0" set Bugzilla Reports 14707 and 14709. +* config attribute added to set the location of a specific PVCS .cfg file + Bugzilla Report 9752 + Changes from Ant 1.5.2 to Ant 1.5.3 =================================== diff --git a/docs/manual/OptionalTasks/pvcstask.html b/docs/manual/OptionalTasks/pvcstask.html index 2473c7da8..b13647360 100644 --- a/docs/manual/OptionalTasks/pvcstask.html +++ b/docs/manual/OptionalTasks/pvcstask.html @@ -22,6 +22,7 @@ by Version 1.1 - 2001/06/27

Problems with UNC pathnames and the use of () in paths are fixed and an updateonly @@ -100,6 +101,16 @@ promotion group and with that label to be extracted. No + +config + +path of a non default .cfg file. +Can be given absolute or relative to ant's base directory. + + +No + + force diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java b/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java index b7cf8fa26..7176dfdb1 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java @@ -81,12 +81,12 @@ import org.apache.tools.ant.types.Commandline; * PVCS is a version control system * developed by Merant. *
- * Before using this tag, the user running ant must have access to the commands + * Before using this tag, the user running ant must have access to the commands * of PVCS (get and pcli) and must have access to the repository. Note that the way to specify * the repository is platform dependent so use property to specify location of repository. *
* This version has been tested agains PVCS version 6.5 and 6.6 under Windows and Solaris. - + * * 19-04-2001

The task now has a more robust * parser. It allows for platform independant file paths @@ -107,6 +107,7 @@ import org.apache.tools.ant.types.Commandline; * @author Thomas Christensen * @author Don Jeffery * @author Steven E. Newton + * @author Jon Dickinson */ public class Pvcs extends org.apache.tools.ant.Task { private String pvcsbin; @@ -123,6 +124,7 @@ public class Pvcs extends org.apache.tools.ant.Task { private String filenameFormat; private String lineStart; private String userId; + private String config; /** * Constant for the thing to execute */ @@ -199,7 +201,7 @@ public class Pvcs extends org.apache.tools.ant.Task { // default pvcs project is "/" if (getPvcsproject() == null && getPvcsprojects().isEmpty()) { - pvcsProject = "/"; + pvcsProject = "/"; } if (getPvcsproject() != null) { @@ -226,14 +228,14 @@ public class Pvcs extends org.apache.tools.ant.Task { tmp2 = new File("pvcs_ant_" + rand.nextLong() + ".log"); log(commandLine.describeCommand(), Project.MSG_VERBOSE); try { - result = runCmd(commandLine, - new PumpStreamHandler(fos, + result = runCmd(commandLine, + new PumpStreamHandler(fos, new LogOutputStream(this, Project.MSG_WARN))); } finally { fos.close(); } - + if (result != 0 && !ignorerc) { String msg = "Failed executing: " + commandLine.toString(); throw new BuildException(msg, getLocation()); @@ -256,6 +258,11 @@ public class Pvcs extends org.apache.tools.ant.Task { commandLine.clearArgs(); commandLine.setExecutable(getExecutable(GET_EXE)); + if(getConfig() != null && getConfig().length()>0) + { + commandLine.createArgument().setValue("-c" + getConfig()); + } + if (getForce() != null && getForce().equals("yes")) { commandLine.createArgument().setValue("-Y"); } else { @@ -338,18 +345,18 @@ public class Pvcs extends org.apache.tools.ant.Task { if (index > -1) { File dir = new File(f.substring(0, index)); if (!dir.exists()) { - log("Creating " + dir.getAbsolutePath(), + log("Creating " + dir.getAbsolutePath(), Project.MSG_VERBOSE); if (dir.mkdirs()) { - log("Created " + dir.getAbsolutePath(), + log("Created " + dir.getAbsolutePath(), Project.MSG_INFO); } else { - log("Failed to create " - + dir.getAbsolutePath(), + log("Failed to create " + + dir.getAbsolutePath(), Project.MSG_INFO); } } else { - log(dir.getAbsolutePath() + " exists. Skipping", + log(dir.getAbsolutePath() + " exists. Skipping", Project.MSG_VERBOSE); } } else { @@ -367,7 +374,7 @@ public class Pvcs extends org.apache.tools.ant.Task { } } } - + /** * Simple hack to handle the PVCS command-line tools botch when @@ -416,7 +423,7 @@ public class Pvcs extends org.apache.tools.ant.Task { /** * The format of the folder names; optional. - * This must be in a format suitable for + * This must be in a format suitable for * java.text.MessageFormat. * Index 1 of the format will be used as the file name. * Defaults to {0}-arc({1}) @@ -445,7 +452,7 @@ public class Pvcs extends org.apache.tools.ant.Task { * need to change this value, UNC names will always be * accepted. */ - + public void setLineStart(String l) { lineStart = l; } @@ -492,10 +499,10 @@ public class Pvcs extends org.apache.tools.ant.Task { } /** - * Workspace to use; optional. + * Workspace to use; optional. * By specifying a workspace, the files are extracted to that location. - * A PVCS workspace is a name for a location of the workfiles and - * isn't as such the location itself. + * A PVCS workspace is a name for a location of the workfiles and + * isn't as such the location itself. * You define the location for a workspace using the PVCS GUI clients. * If this isn't specified the default workspace for the current user is used. * @param ws String @@ -536,12 +543,12 @@ public class Pvcs extends org.apache.tools.ant.Task { /** * Specifies the value of the force argument; optional. - * If set to yes all files that exists and are - * writable are overwritten. Default no causes the files - * that are writable to be ignored. This stops the PVCS command + * If set to yes all files that exists and are + * writable are overwritten. Default no causes the files + * that are writable to be ignored. This stops the PVCS command * get to stop asking questions! * @todo make a boolean setter - * @param repo String (yes/no) + * @param f String (yes/no) */ public void setForce(String f) { if (f != null && f.equalsIgnoreCase("yes")) { @@ -561,7 +568,7 @@ public class Pvcs extends org.apache.tools.ant.Task { /** * Specifies the name of the promotiongroup argument - * @param repo String + * @param w String */ public void setPromotiongroup(String w) { promotiongroup = w; @@ -577,7 +584,7 @@ public class Pvcs extends org.apache.tools.ant.Task { /** * Only files marked with this label are extracted; optional. - * @param repo String + * @param l String */ public void setLabel(String l) { label = l; @@ -617,7 +624,7 @@ public class Pvcs extends org.apache.tools.ant.Task { /** * Specify a project within the PVCS repository to extract files from. - * @param PvcsProject + * @param p */ public void addPvcsproject(PvcsProject p) { pvcsProjects.addElement(p); @@ -628,13 +635,31 @@ public class Pvcs extends org.apache.tools.ant.Task { } /** - * If set to true files are fetched only if + * If set to true files are fetched only if * newer than existing local files; optional, default false. */ public void setUpdateOnly(boolean l) { updateOnly = l; } + /** + * returns the path of the configuration file to be used + * @return the path of the config file + */ + public String getConfig() { + return config; + } + + /** + * Sets a configuration file other than the default to be used. + * These files have a .cfg extension and are often found in archive or pvcsprop folders. + * @param f config file - can be given absolute or relative to ant basedir + */ + public void setConfig(File f) { + config = f.toString(); + } + + public String getUserId() { return userId; } @@ -643,7 +668,7 @@ public class Pvcs extends org.apache.tools.ant.Task { * User ID; unused. * @ant.attribute ignore="true" */ - + public void setUserId(String u) { userId = u; }