Browse Source

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>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269672 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
e598dc86b6
1 changed files with 25 additions and 3 deletions
  1. +25
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java

+ 25
- 3
src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java View File

@@ -87,6 +87,7 @@ import org.apache.tools.ant.types.Commandline;
*
* @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 @@ 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})";
}
}

Loading…
Cancel
Save