From e598dc86b6b270e341c0c2c758fae527d3c8cfda Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Thu, 6 Sep 2001 02:48:08 +0000 Subject: [PATCH] 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 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269672 13f79535-47bb-0310-9956-ffa450edef68 --- .../ant/taskdefs/optional/pvcs/Pvcs.java | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) 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 1ea35166b..67d11e4f0 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 @@ -87,6 +87,7 @@ import org.apache.tools.ant.types.Commandline; * * @author Thomas Christensen * @author Don Jeffery + * @author Steven E. Newton */ public class Pvcs extends org.apache.tools.ant.Task { private String pvcsbin; @@ -99,7 +100,8 @@ public class Pvcs extends org.apache.tools.ant.Task { 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 @@ public class Pvcs extends org.apache.tools.ant.Task { */ 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 @@ public class Pvcs extends org.apache.tools.ant.Task { 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 @@ public class Pvcs extends org.apache.tools.ant.Task { label=null; ignorerc=false; updateOnly = false; + lineStart="\"P:"; + filenameFormat="{0}_arc({1})"; } }