From 541c0119908b6df18b00e8d38ea91ebc9f388366 Mon Sep 17 00:00:00 2001 From: Magesh Umasankar Date: Sat, 2 Feb 2002 17:01:25 +0000 Subject: [PATCH] Add -id option PR: 4572 Submitted by: Steven E. Newton (snewton@io.com) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271090 13f79535-47bb-0310-9956-ffa450edef68 --- .../ant/taskdefs/optional/pvcs/Pvcs.java | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 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 32c4b18c0..9f1ccfc5f 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 @@ -2,7 +2,7 @@ * * The Apache Software License, Version 1.1 * - * Copyright (c) 2001 The Apache Software Foundation. All rights + * Copyright (c) 2001-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -87,10 +87,10 @@ import org.apache.tools.ant.types.Commandline; * and supports file names with (). Thanks to Erik Husby for * bringing the bug to my attention. * - * 27-04-2001

UNC paths are now handled properly. + * 27-04-2001

UNC paths are now handled properly. * Fix provided by Don Jeffery. He also added an UpdateOnly flag - * that, when true, conditions the PVCS get using the -U option to only - * update those files that have a modification time (in PVCS) that is newer + * that, when true, conditions the PVCS get using the -U option to only + * update those files that have a modification time (in PVCS) that is newer * than the existing workfile. * * @author Thomas Christensen @@ -110,6 +110,7 @@ public class Pvcs extends org.apache.tools.ant.Task { private boolean updateOnly; private String filenameFormat; private String lineStart; + private String userId; /** * Constant for the thing to execute */ @@ -160,7 +161,7 @@ public class Pvcs extends org.apache.tools.ant.Task { Project aProj = getProject(); int result = 0; - if(repository == null || repository.trim().equals("")) { + if(repository == null || repository.trim().equals("")) { throw new BuildException("Required argument repository not specified"); } @@ -179,6 +180,12 @@ public class Pvcs extends org.apache.tools.ant.Task { } commandLine.createArgument().setValue("-pr"+getRepository()); + String uid = getUserId(); + + if (uid != null) { + commandLine.createArgument().setValue("-id" + uid); + } + // default pvcs project is "/" if(getPvcsproject() == null && getPvcsprojects().isEmpty()) { pvcsProject = "/"; @@ -281,8 +288,8 @@ public class Pvcs extends org.apache.tools.ant.Task { 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]; @@ -301,7 +308,7 @@ public class Pvcs extends org.apache.tools.ant.Task { log(dir.getAbsolutePath() + " exists. Skipping", Project.MSG_VERBOSE); } } else { - log("File separator problem with " + line, + log("File separator problem with " + line, Project.MSG_WARN); } } else { @@ -401,7 +408,7 @@ public class Pvcs extends org.apache.tools.ant.Task { } /** - * Get name of the PVCS bin directory + * Get name of the PVCS bin directory * @return String */ public String getPvcsbin() { @@ -446,7 +453,7 @@ public class Pvcs extends org.apache.tools.ant.Task { /** * Specifies the name of the promotiongroup argument - * @param repo String + * @param repo String */ public void setPromotiongroup(String w) { promotiongroup=w; @@ -462,7 +469,7 @@ public class Pvcs extends org.apache.tools.ant.Task { /** * Specifies the name of the label argument - * @param repo String + * @param repo String */ public void setLabel(String l) { label=l; @@ -477,7 +484,7 @@ public class Pvcs extends org.apache.tools.ant.Task { } /** - * If set to true the return value from executing the pvcs + * If set to true the return value from executing the pvcs * commands are ignored. */ public void setIgnoreReturnCode(boolean b) { @@ -504,6 +511,14 @@ public class Pvcs extends org.apache.tools.ant.Task { updateOnly = l; } + public String getUserId() { + return userId; + } + + public void setUserId(String u) { + userId = u; + } + /** * Creates a Pvcs object */