Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 4833 invoked from network); 2 Jun 2000 15:26:03 -0000 Received: from smtp01do.de.uu.net (192.76.144.61) by locus.apache.org with SMTP; 2 Jun 2000 15:26:03 -0000 Received: from sbodewig.bost.de ([195.127.75.69]) by smtp01do.de.uu.net (5.5.5/5.5.5) with ESMTP id RAA09612 for ; Fri, 2 Jun 2000 17:26:01 +0200 (MET DST) Received: (from bodewig@localhost) by sbodewig.bost.de (8.9.3/8.9.3) id RAA13407; Fri, 2 Jun 2000 17:26:00 +0200 X-Authentication-Warning: sbodewig.bost.de: bodewig set sender to bodewig@bost.de using -f To: ant-dev@jakarta.apache.org Subject: [PATCH] extended CVS task From: Stefan Bodewig Date: 02 Jun 2000 17:26:00 +0200 Message-ID: Lines: 27 User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Canyonlands) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N --=-=-= Hi, this is a repost of Wolfgang Werner's patch from mid April (thanks Vitaly). It has been edited to minimize the number of changed lines and to reflect a change that has been commited since then. This patch adds quiet and noexec attributes (for the -q and -n switches) and a command attribute that specifies which CVS command to execute. The default command is "checkout" to remain compatible to the existing task. cvsroot and package are no longer required attributes as most CVS commands can and will retrieve the values from the CVS/ dirs in the destination directory. One thing I'm still missing here is the MatchingTask functionality to specify only a set of files to commit/tag etc. I just wanted to wait whether Exec (Cvs's parent class) becomes a MatchingTask - which would add the funcionality almost automatically. Stefan --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=ant.cvs.patch Index: docs/index.html =================================================================== RCS file: /home/cvspublic/jakarta-ant/docs/index.html,v retrieving revision 1.21 diff -u -r1.21 index.html --- docs/index.html 2000/06/01 06:54:52 1.21 +++ docs/index.html 2000/06/02 15:14:32 @@ -713,10 +723,10 @@

Cvs

Description

-

Checks out a package/module from a CVS -repository.

+

Handles packages/modules retrieved from a +CVS repository.

When doing automated builds, the get task should be -preferred, because of speed.

+preferred over the checkout command, because of speed.

Parameters

@@ -725,9 +735,14 @@ + + + + + - + @@ -737,13 +752,23 @@ - + + + + + + + + + + +
Required
commandthe CVS command to execute.No, default "checkout"
cvsRoot the CVSROOT variable.YesNo
dest
package the package/module to check out.YesNo
tag the tag of the package/module to check out. No
quietsupress informational messages.No, default "false"
noexecreport only, don't change any files.No, default "false"

Examples

  <cvs cvsRoot=":pserver:anoncvs@jakarta.apache.org:/home/cvspublic"
@@ -752,6 +777,9 @@
   />

checks out the package/module "jakarta-tools" from the CVS repository pointed to by the cvsRoot attribute, and stores the files in "${ws.dir}".

+
  <cvs dest="${ws.dir}" command="update" />
+

updates the package/module that has previously been checked out into +"${ws.dir}".


Delete

Description

Index: src/main/org/apache/tools/ant/taskdefs/Cvs.java =================================================================== RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Cvs.java,v retrieving revision 1.4 diff -u -r1.4 Cvs.java --- src/main/org/apache/tools/ant/taskdefs/Cvs.java 2000/05/24 06:45:05 1.4 +++ src/main/org/apache/tools/ant/taskdefs/Cvs.java 2000/06/02 15:14:33 @@ -69,6 +69,9 @@ private String cvsRoot; private String pack; private String tag; + private String command = "checkout"; + private boolean quiet = false; + private boolean noexec = false; public void execute() throws BuildException { @@ -76,16 +79,32 @@ // execution so that we don't rely on having native CVS stuff around (SM) StringBuffer sb=new StringBuffer(); - sb.append(" cvs -d ").append( cvsRoot ).append(" checkout "); + sb.append(" cvs -d "); + if (cvsRoot != null) { + sb.append(cvsRoot).append(" "); + } + + sb.append(noexec ? "-n " : "") + .append(quiet ? "-q " : "") + .append(command).append(" "); + if (tag!=null) sb.append("-r ").append(tag).append(" "); - sb.append( pack ); + if (pack != null) { + sb.append(pack); + } run(sb.toString()); } public void setCvsRoot(String root) { + // Check if not real cvsroot => set it to null + if (root != null) { + if (root.trim().equals("")) + root = null; + } + this.cvsRoot = root; } @@ -107,6 +126,17 @@ this.tag = p; } + public void setCommand(String c) { + this.command = c; + } + + public void setQuiet(String q) { + quiet = Project.toBoolean(q); + } + + public void setNoexec(String ne) { + noexec = Project.toBoolean(ne); + } } --=-=-=--