You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Josh Lucas <jo...@stonecottage.com> on 2000/11/04 04:20:04 UTC

[PATCH] Cvs task: adding co -d functionality

In my build process, I need to checkout various modules into differently
named directories.  The current version of the Cvs task doesn't do this
but this patch should allow this functionality.


josh

Re: [PATCH] Cvs task: adding co -d functionality

Posted by Stefan Bodewig <bo...@bost.de>.
Julian M. Savage <js...@fisci.com> wrote:

> Btw, with just a few more features I might be able to implement
> patch creation and submission with cvs using ant.

What features would that be? patch creation using cvs diff should
already work. Using mail to send the patch (and patch to apply it
automatically) looks straight forward as well.

Stefan

Re: [PATCH] Cvs task: adding co -d functionality

Posted by "Julian M. Savage" <js...@fisci.com>.
Stefan,

I'm not sure which you were asking for, but here's a shot at better
documentation, anyway. Btw, with just a few more features I might be able to
implement patch creation and submission with cvs using ant.

Julian.

Index: docs/index.html
===================================================================
RCS file: /home/cvspublic/jakarta-ant/docs/index.html,v
retrieving revision 1.146
diff -u -r1.146 index.html
--- docs/index.html     2000/11/06 14:10:56     1.146
+++ docs/index.html     2000/11/08 11:43:08
@@ -1434,7 +1434,7 @@
 <h2><a name="cvs">Cvs</a></h2>
 <h3>Description</h3>
 <p>Handles packages/modules retrieved from a
-<a href="http://www.cyclic.com/">CVS</a> repository.</p>
+<a href="http://www.cvshome.org/">CVS</a> repository.</p>
 <p>When doing automated builds, the <a href="#get">get task</a> should be
 preferred over the <i>checkout</i> command, because of speed.</p>
 <h3>Parameters</h3>
@@ -1505,6 +1505,11 @@
 <pre>  &lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot;
/&gt;</pre>
 <p>updates the package/module that has previously been checked out into
 &quot;${ws.dir}&quot;.</p>
+<pre>  &lt;cvs command=&quot;-q diff -u -N&quot;
output="patch.txt"/&gt;</pre>
+<p>silently (-q) creates a file called patch.txt which contains a unified
(-u) diff which includes new files added via &quot;cvs add&quot; (-N) and
can be used as input to patch.</p>
+<pre>  &lt;cvs command=&quot;update -A -d&quot;/&gt;</pre>
+<p>Updates from the head of repository ignoring sticky bits (-A) and
creating any new directories as necessary (-d).</p>
+<p>Note: the text of the command is passed to cvs &quot;as-is&quot; so any
cvs options should appear before the command, and any command options should
appear after the command as in the diff example above. See <a
href="http://www.cvshome.org/docs/manual/index.html">the cvs manual</a> for
details, specifically the <a
href="http://www.cvshome.org/docs/manual/cvs_16.html">Guide to CVS
commands</a></p>
 <hr>
 <h2><a name="delete">Delete</a></h2>
 <h3>Description</h3>

----- Original Message -----
From: "Stefan Bodewig" <bo...@bost.de>
To: <an...@jakarta.apache.org>
Sent: Monday, November 06, 2000 6:00 PM
Subject: Re: [PATCH] Cvs task: adding co -d functionality


> >>>>> "JMS" == Julian M Savage <js...@fisci.com> writes:
>
>  JMS> I discovered that you can actually pass any options to the cvs
>  JMS> command directly,
>
> Yes, it has been broken some time, when the task used
> setValue(command) instead of setLine(command). I usually have
> something like command="update -d -P".
>
>  JMS> although perhaps if the cvs task itself were better
>  JMS> documented/more intuitive
>
> want to give it a try 8-)
>
> Stefan
>


Re: [PATCH] Cvs task: adding co -d functionality

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "JMS" == Julian M Savage <js...@fisci.com> writes:

 JMS> I discovered that you can actually pass any options to the cvs
 JMS> command directly,

Yes, it has been broken some time, when the task used
setValue(command) instead of setLine(command). I usually have
something like command="update -d -P".

 JMS> although perhaps if the cvs task itself were better
 JMS> documented/more intuitive

want to give it a try 8-)

Stefan

Re: [PATCH] Cvs task: adding co -d functionality

Posted by "Julian M. Savage" <js...@fisci.com>.
I discovered that you can actually pass any options to the cvs command
directly, so your patch isn't really necessary (although perhaps if the cvs
task itself were better documented/more intuitive you would have realised
this).

<cvs command="update -d"/>

Would probably work.

Julian.
----- Original Message -----
From: "Josh Lucas" <jo...@stonecottage.com>
To: <an...@jakarta.apache.org>
Sent: Saturday, November 04, 2000 12:20 PM
Subject: [PATCH] Cvs task: adding co -d functionality


> In my build process, I need to checkout various modules into differently
> named directories.  The current version of the Cvs task doesn't do this
> but this patch should allow this functionality.
>
>
> josh


----------------------------------------------------------------------------
----


> Index: Cvs.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Cvs.java,
v
> retrieving revision 1.12
> diff -u -r1.12 Cvs.java
> --- Cvs.java 2000/10/06 07:40:16 1.12
> +++ Cvs.java 2000/11/04 03:15:15
> @@ -110,6 +110,12 @@
>       */
>      private File error;
>
> +    /**
> +     * the directory name which the working copy will be named
> +     */
> +    private String destDirName;
> +
> +
>      public void execute() throws BuildException {
>
>          // XXX: we should use JCVS (www.ice.com/JCVS) instead of command
line
> @@ -130,8 +136,14 @@
>          }
>          if (quiet) {
>              toExecute.createArgument().setValue("-q");
> +        }
> +        if ( (destDirName != null) && (command.equals("checkout")) ) {
> +            toExecute.createArgument().setValue(command);
> +            toExecute.createArgument().setValue("-d");
> +            toExecute.createArgument().setValue(destDirName);
>          }
> -        toExecute.createArgument().setLine(command);
> +        else
> +            toExecute.createArgument().setLine(command);
>          toExecute.addArguments(cmd.getCommandline());
>
>          if (pack != null) {
> @@ -247,6 +259,10 @@
>
>      public void setError(File error) {
>          this.error = error;
> +    }
> +
> +    public void setDestDirName(String d) {
> +        this.destDirName = d;
>      }
>  }
>
>