antoine     2003/05/29 14:35:43

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/pvcs
                        Pvcs.java
               docs/manual/OptionalTasks pvcstask.html
               .        WHATSNEW
  Log:
  config attribute added to set the location of a specific PVCS .cfg file
  PR: 9752
  Submitted by: Jon Dickinson (dickinson dot j at ucles dot org dot uk )
  
  Revision  Changes    Path
  1.23      +51 -26    
ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
  
  Index: Pvcs.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Pvcs.java 10 Feb 2003 14:14:22 -0000      1.22
  +++ Pvcs.java 29 May 2003 21:35:42 -0000      1.23
  @@ -81,12 +81,12 @@
    * PVCS is a version control system
    * developed by <a href="http://www.merant.com/products/pvcs";>Merant</a>.
    * <br>
  - * 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.
    * <br>
    * This version has been tested agains PVCS version 6.5 and 6.6 under 
Windows and Solaris.
  - 
  +
    *
    * <b>19-04-2001</b> <p>The task now has a more robust
    * parser. It allows for platform independant file paths
  @@ -107,6 +107,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]">Thomas Christensen</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Don Jeffery</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Steven E. Newton</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]">Jon Dickinson</a>
    */
   public class Pvcs extends org.apache.tools.ant.Task {
       private String pvcsbin;
  @@ -123,6 +124,7 @@
       private String filenameFormat;
       private String lineStart;
       private String userId;
  +    private String config;
       /**
        * Constant for the thing to execute
        */
  @@ -199,7 +201,7 @@
   
           // default pvcs project is "/"
           if (getPvcsproject() == null && getPvcsprojects().isEmpty()) {
  -                     pvcsProject = "/";
  +            pvcsProject = "/";
           }
   
           if (getPvcsproject() != null) {
  @@ -226,14 +228,14 @@
               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 @@
               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 @@
                       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 @@
               }
           }
       }
  -        
  +
   
       /**
        * Simple hack to handle the PVCS command-line tools botch when
  @@ -416,7 +423,7 @@
   
       /**
        * The format of the folder names; optional.
  -     * This must be in a format suitable for 
  +     * This must be in a format suitable for
        * <code>java.text.MessageFormat</code>.
        *  Index 1 of the format will be used as the file name.
        *  Defaults to <code>{0}-arc({1})</code>
  @@ -445,7 +452,7 @@
        * need to change this value, UNC names will always be
        * accepted.
        */
  -        
  +
       public void setLineStart(String l) {
           lineStart = l;
       }
  @@ -492,10 +499,10 @@
       }
   
       /**
  -     * 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 @@
   
       /**
        * Specifies the value of the force argument; optional.
  -     * If set to <i>yes</i> all files that exists and are 
  -     * writable are overwritten. Default <i>no</i> causes the files 
  -     * that are writable to be ignored. This stops the PVCS command 
  +     * If set to <i>yes</i> all files that exists and are
  +     * writable are overwritten. Default <i>no</i> causes the files
  +     * that are writable to be ignored. This stops the PVCS command
        * <i>get</i> 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 @@
   
       /**
        * Specifies the name of the promotiongroup argument
  -     * @param repo String
  +     * @param w String
        */
       public void setPromotiongroup(String w) {
           promotiongroup = w;
  @@ -577,7 +584,7 @@
   
       /**
        * 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 @@
   
       /**
        * 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 @@
       }
   
       /**
  -     * If set to <i>true</i> files are fetched only if 
  +     * If set to <i>true</i> 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 @@
        * User ID; unused.
        * @ant.attribute ignore="true"
        */
  -     
  +
       public void setUserId(String u) {
           userId = u;
       }
  
  
  
  1.8       +11 -0     ant/docs/manual/OptionalTasks/pvcstask.html
  
  Index: pvcstask.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/OptionalTasks/pvcstask.html,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- pvcstask.html     28 Mar 2003 12:51:51 -0000      1.7
  +++ pvcstask.html     29 May 2003 21:35:42 -0000      1.8
  @@ -22,6 +22,7 @@
   <ul>
     <li>Thomas Christensen (<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>)</li>
     <li>Don Jeffery (<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>)</li>
  +  <li>Jon Dickinson (<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>)</li>
   </ul>
   Version 1.1 - 2001/06/27<br>
   <p>Problems with UNC pathnames and the use of () in paths are fixed and an 
updateonly
  @@ -95,6 +96,16 @@
   <td VALIGN=TOP WIDTH="78%">Only files within this promotion group are 
extracted. Using
   both the <i>label</i> and the <i>promotiongroup</i> tag will cause the files 
in the
   promotion group and with that label to be extracted.
  +</td>
  +
  +<td VALIGN=TOP WIDTH="10%">No</td>
  +</tr>
  +
  +<tr>
  +<td VALIGN=TOP WIDTH="12%">config</td>
  +
  +<td VALIGN=TOP WIDTH="78%">path of a non default .cfg file.
  +Can be given absolute or relative to ant's base directory.
   </td>
   
   <td VALIGN=TOP WIDTH="10%">No</td>
  
  
  
  1.433     +3 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.432
  retrieving revision 1.433
  diff -u -r1.432 -r1.433
  --- WHATSNEW  29 May 2003 15:35:26 -0000      1.432
  +++ WHATSNEW  29 May 2003 21:35:42 -0000      1.433
  @@ -395,6 +395,9 @@
     if ejbjar has cmpversion="2.0" set
     Bugzilla Reports 14707 and 14709.
   
  +* <pvcs> 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
   ===================================
   
  
  
  

Reply via email to