ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Newton <snew...@standard.com>
Subject [PATCH] Ant pvcs task & Bug 3219
Date Wed, 05 Sep 2001 21:44:48 GMT
Hello,

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


--- Pvcs.java.orig	Wed Sep 05 14:33:10 2001
+++ Pvcs.java	Wed Sep 05 14:34:19 2001
@@ -86,8 +86,9 @@
  * than the existing workfile.
  *
  * @author Thomas Christensen <tchristensen@nordija.com>
- * @author Don Jeffery <donj@apogeenet.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;
     private String repository;
@@ -99,6 +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 +260,11 @@
      */
     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(getLineStart())) {
                 Object[] objs = mf.parse(line);
                 String f = (String)objs[1];
                 // Extract the name of the directory from the filename
@@ -465,6 +468,22 @@
         updateOnly = l;
     }
 
+    public String getFilenameFormat() {
+				return filenameFormat;
+		}
+
+		public void setFilenameFormat(String f) {
+				filenameFormat = f;
+		}
+
+		public String getLineStart() {
+				return lineStart;
+		}
+
+		public void setLineStart(String l) {
+				lineStart = l;
+		}
+
     /**
      * Creates a Pvcs object
      */
@@ -480,5 +499,9 @@
         label=null;
         ignorerc=false;
         updateOnly = false;
+        lineStart="\"P:";
+        filenameFormat="{0}_v({1})";
+
     }
 }

----
                  Steven E. Newton, Software Developer
     Standard Insurance Company, 1100 SW Sixth Ave -- 503.321.8729 

Mime
View raw message