ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs Pvcs.java
Date Thu, 06 Sep 2001 02:48:08 GMT
donaldp     01/09/05 19:48:08

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/pvcs
                        Pvcs.java
  Log:
  I have used the pvcs task and have come up with a patch that
  I believe will address Bug ID 3219 in a slightly more flexible
  way, and also allows the archive filename extension to vary
  from the format hardcoded in the createFolders() method in
  Pvcs.java
  
  Submitted by: Steven Newton <snewton@standard.com>
  
  Revision  Changes    Path
  1.3       +25 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
  
  Index: Pvcs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Pvcs.java	2001/07/13 13:57:40	1.2
  +++ Pvcs.java	2001/09/06 02:48:08	1.3
  @@ -87,6 +87,7 @@
    *
    * @author Thomas Christensen <tchristensen@nordija.com>
    * @author Don Jeffery <donj@apogeenet.com>
  + * @author Steven E. Newton <snewton@standard.com>
    */
   public class Pvcs extends org.apache.tools.ant.Task {
       private String pvcsbin;
  @@ -99,7 +100,8 @@
       private String label;
       private boolean ignorerc;
       private boolean updateOnly;
  -
  +    private String filenameFormat;
  +    private String lineStart;
       /**
        * Constant for the thing to execute
        */
  @@ -257,11 +259,13 @@
        */
       private void createFolders(File file) throws IOException, ParseException {
           BufferedReader in = new BufferedReader(new FileReader(file));
  -        MessageFormat mf = new MessageFormat("{0}-arc({1})");
  +        MessageFormat mf = new MessageFormat( getFilenameFormat() );
           String line = in.readLine();
           while(line != null) {
               log("Considering \""+line+"\"", Project.MSG_VERBOSE);
  -            if(line.startsWith("\"\\") || line.startsWith("\"/")) {
  +            if(line.startsWith("\"\\") || 
  +               line.startsWith("\"/") || 
  +               line.startsWith(getLineStart()) ) {
                   Object[] objs = mf.parse(line);
                   String f = (String)objs[1];
                   // Extract the name of the directory from the filename
  @@ -314,6 +318,22 @@
           return repository;
       }
   
  +    public String getFilenameFormat() {
  +        return filenameFormat;
  +    }
  +
  +    public void setFilenameFormat(String f) {
  +        filenameFormat = f;
  +    }
  +
  +    public String getLineStart() {
  +        return lineStart;
  +    }
  +
  +    public void setLineStart(String l) {
  +        lineStart = l;
  +    }
  +
       /**
        * Specifies the network name of the PVCS repository
        * @param repo String
  @@ -480,5 +500,7 @@
           label=null;
           ignorerc=false;
           updateOnly = false;
  +        lineStart="\"P:";
  +        filenameFormat="{0}_arc({1})";
       }
   }
  
  
  

Mime
View raw message