conor 2003/01/29 02:48:17 Modified: src/main/org/apache/tools/ant/taskdefs/optional/perforce P4Label.java Log: iAllow several views per label PR: 12585 Submitted By: Steve Hunter Revision Changes Path 1.13 +16 -13 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Label.java Index: P4Label.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Label.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -u -r1.12 -r1.13 --- P4Label.java 25 Jul 2002 15:21:18 -0000 1.12 +++ P4Label.java 29 Jan 2003 10:48:17 -0000 1.13 @@ -63,7 +63,7 @@ import java.util.Date; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; - +import org.apache.tools.ant.util.StringUtils; /** * Creates a new Perforce label and set contents to reflect current @@ -114,10 +114,14 @@ if (P4View == null || P4View.length() < 1) { log("View not set, assuming //depot/...", Project.MSG_WARN); P4View = "//depot/..."; + } else { + P4View = StringUtils.replace(P4View, ":", "\n\t"); + P4View = StringUtils.replace(P4View, ";", "\n\t"); } if (desc == null || desc.length() < 1) { - log("Label Description not set, assuming 'AntLabel'", Project.MSG_WARN); + log("Label Description not set, assuming 'AntLabel'", + Project.MSG_WARN); desc = "AntLabel"; } @@ -126,7 +130,8 @@ } if (name == null || name.length() < 1) { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd-hh:mm"); + SimpleDateFormat formatter + = new SimpleDateFormat("yyyy.MM.dd-hh:mm"); Date now = new Date(); name = "AntLabel-" + formatter.format(now); log("name not set, assuming '" + name + "'", Project.MSG_WARN); @@ -135,10 +140,10 @@ //We have to create a unlocked label first String newLabel = - "Label: " + name + "\n" + - "Description: " + desc + "\n" + - "Options: unlocked\n" + - "View: " + P4View + "\n"; + "Label: " + name + + "\nDescription: " + desc + + "\nOptions: unlocked" + + "\nView: \n\t" + P4View; P4Handler handler = new P4HandlerAdapter() { public void process(String line) { @@ -157,7 +162,8 @@ }); - log("Created Label " + name + " (" + desc + ")", Project.MSG_INFO); + log("Created Label " + name + " (" + desc + ") with view:\n" + P4View, + Project.MSG_INFO); //Now lock if required if (lock != null && lock.equalsIgnoreCase("locked")) { @@ -196,8 +202,5 @@ handler.setOutput(labelSpec.toString()); execP4Command("label -i", handler); } - - } - }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]