You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Fu-Tung Cheng <fu...@yahoo.com> on 2008/09/10 08:54:43 UTC

svn-ant how to get latest revision?

Hi,

I am trying to figure out which command I can use from svn-ant that will get me the highest revision from the repository.  

I've tried svn-info but both the rev and lastRev properties return the working copies revision number.

I've also tried the wcVersion task but again that just tells you the working copies last revision.

In order for me to get the information it appears I need to update my working copy to the latest and then call one of these targets.  Shouldn't there be a way using svn-ant to just get the latest version?

Does no one automate tasks using ant and svn?  The svn-ant tasks seem somewhat less mature than I would have expected.  

If I was using maven to do my building would I find better support?


Thank you,

Fu-Tung


      


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Re: svn-ant how to get latest revision?

Posted by Mark Reibert <sv...@reibert.com>.
Yup, although it was my impression the OP did not want to update ...

Also, a purist like me prefers to build from "svn export" rather than
"svn co", in which case "svnversion -c" is not an option (so I use other
tricks involving "svn info" on repo tags).

On Mon, 2008-09-15 at 17:41 -0700, DW Dennis Wheeler wrote:
> or you can simply use 
>   svnversion -c 
> on your working directory 
> (both before and after an 'svn update' for starting and ending revision
> numbers to generate changelogs for the build)
> 
> 
> > -----Original Message-----
> > From: Mark Reibert [mailto:mark@reibert.com] 
> > Sent: Wednesday, September 10, 2008 9:53 PM
> > To: futung.cheng@yahoo.com
> > Cc: users@subversion.tigris.org; user@ant.apache.org
> > Subject: Re: svn-ant how to get latest revision?
> > 
> > Use svn info on the repository itself (not your working 
> > copy). Something
> > like:
> > 
> > svn info $( svn info | grep 'Root:' | awk -F': ' '{print $2}' ) \
> >     | grep Revision | awk '{print $2}'
> > 
> > 
> > On Tue, 2008-09-09 at 23:54 -0700, Fu-Tung Cheng wrote:
> > > Hi,
> > > 
> > > I am trying to figure out which command I can use from 
> > svn-ant that will get me the highest revision from the repository.  
> > > 
> > > I've tried svn-info but both the rev and lastRev properties 
> > return the working copies revision number.
> > > 
> > > I've also tried the wcVersion task but again that just 
> > tells you the working copies last revision.
> > > 
> > > In order for me to get the information it appears I need to 
> > update my working copy to the latest and then call one of 
> > these targets.  Shouldn't there be a way using svn-ant to 
> > just get the latest version?
> > > 
> > > Does no one automate tasks using ant and svn?  The svn-ant 
> > tasks seem somewhat less mature than I would have expected.  
> > > 
> > > If I was using maven to do my building would I find better support?
> > > 
> > > 
> > > Thank you,
> > > 
> > > Fu-Tung
> > > 
> > > 
> > >       
> > > 
> > > 
> > > 
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > > For additional commands, e-mail: users-help@subversion.tigris.org
> > > 
> > > 
> > --
> > ----------------------
> > Mark S. Reibert, Ph.D.
> > mark@reibert.com
> > ----------------------
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 

-- 
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Re: svn-ant how to get latest revision?

Posted by Mark Reibert <sv...@reibert.com>.
Yup, although it was my impression the OP did not want to update ...

Also, a purist like me prefers to build from "svn export" rather than
"svn co", in which case "svnversion -c" is not an option (so I use other
tricks involving "svn info" on repo tags).

On Mon, 2008-09-15 at 17:41 -0700, DW Dennis Wheeler wrote:
> or you can simply use 
>   svnversion -c 
> on your working directory 
> (both before and after an 'svn update' for starting and ending revision
> numbers to generate changelogs for the build)
> 
> 
> > -----Original Message-----
> > From: Mark Reibert [mailto:mark@reibert.com] 
> > Sent: Wednesday, September 10, 2008 9:53 PM
> > To: futung.cheng@yahoo.com
> > Cc: users@subversion.tigris.org; user@ant.apache.org
> > Subject: Re: svn-ant how to get latest revision?
> > 
> > Use svn info on the repository itself (not your working 
> > copy). Something
> > like:
> > 
> > svn info $( svn info | grep 'Root:' | awk -F': ' '{print $2}' ) \
> >     | grep Revision | awk '{print $2}'
> > 
> > 
> > On Tue, 2008-09-09 at 23:54 -0700, Fu-Tung Cheng wrote:
> > > Hi,
> > > 
> > > I am trying to figure out which command I can use from 
> > svn-ant that will get me the highest revision from the repository.  
> > > 
> > > I've tried svn-info but both the rev and lastRev properties 
> > return the working copies revision number.
> > > 
> > > I've also tried the wcVersion task but again that just 
> > tells you the working copies last revision.
> > > 
> > > In order for me to get the information it appears I need to 
> > update my working copy to the latest and then call one of 
> > these targets.  Shouldn't there be a way using svn-ant to 
> > just get the latest version?
> > > 
> > > Does no one automate tasks using ant and svn?  The svn-ant 
> > tasks seem somewhat less mature than I would have expected.  
> > > 
> > > If I was using maven to do my building would I find better support?
> > > 
> > > 
> > > Thank you,
> > > 
> > > Fu-Tung
> > > 
> > > 
> > >       
> > > 
> > > 
> > > 
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > > For additional commands, e-mail: users-help@subversion.tigris.org
> > > 
> > > 
> > --
> > ----------------------
> > Mark S. Reibert, Ph.D.
> > mark@reibert.com
> > ----------------------
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 

-- 
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: Re: svn-ant how to get latest revision?

Posted by DW Dennis Wheeler <dw...@ag.com>.
or you can simply use 
  svnversion -c 
on your working directory 
(both before and after an 'svn update' for starting and ending revision
numbers to generate changelogs for the build)


> -----Original Message-----
> From: Mark Reibert [mailto:mark@reibert.com] 
> Sent: Wednesday, September 10, 2008 9:53 PM
> To: futung.cheng@yahoo.com
> Cc: users@subversion.tigris.org; user@ant.apache.org
> Subject: Re: svn-ant how to get latest revision?
> 
> Use svn info on the repository itself (not your working 
> copy). Something
> like:
> 
> svn info $( svn info | grep 'Root:' | awk -F': ' '{print $2}' ) \
>     | grep Revision | awk '{print $2}'
> 
> 
> On Tue, 2008-09-09 at 23:54 -0700, Fu-Tung Cheng wrote:
> > Hi,
> > 
> > I am trying to figure out which command I can use from 
> svn-ant that will get me the highest revision from the repository.  
> > 
> > I've tried svn-info but both the rev and lastRev properties 
> return the working copies revision number.
> > 
> > I've also tried the wcVersion task but again that just 
> tells you the working copies last revision.
> > 
> > In order for me to get the information it appears I need to 
> update my working copy to the latest and then call one of 
> these targets.  Shouldn't there be a way using svn-ant to 
> just get the latest version?
> > 
> > Does no one automate tasks using ant and svn?  The svn-ant 
> tasks seem somewhat less mature than I would have expected.  
> > 
> > If I was using maven to do my building would I find better support?
> > 
> > 
> > Thank you,
> > 
> > Fu-Tung
> > 
> > 
> >       
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
> > 
> > 
> --
> ----------------------
> Mark S. Reibert, Ph.D.
> mark@reibert.com
> ----------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Re: svn-ant how to get latest revision?

Posted by DW Dennis Wheeler <dw...@ag.com>.
or you can simply use 
  svnversion -c 
on your working directory 
(both before and after an 'svn update' for starting and ending revision
numbers to generate changelogs for the build)


> -----Original Message-----
> From: Mark Reibert [mailto:mark@reibert.com] 
> Sent: Wednesday, September 10, 2008 9:53 PM
> To: futung.cheng@yahoo.com
> Cc: users@subversion.tigris.org; user@ant.apache.org
> Subject: Re: svn-ant how to get latest revision?
> 
> Use svn info on the repository itself (not your working 
> copy). Something
> like:
> 
> svn info $( svn info | grep 'Root:' | awk -F': ' '{print $2}' ) \
>     | grep Revision | awk '{print $2}'
> 
> 
> On Tue, 2008-09-09 at 23:54 -0700, Fu-Tung Cheng wrote:
> > Hi,
> > 
> > I am trying to figure out which command I can use from 
> svn-ant that will get me the highest revision from the repository.  
> > 
> > I've tried svn-info but both the rev and lastRev properties 
> return the working copies revision number.
> > 
> > I've also tried the wcVersion task but again that just 
> tells you the working copies last revision.
> > 
> > In order for me to get the information it appears I need to 
> update my working copy to the latest and then call one of 
> these targets.  Shouldn't there be a way using svn-ant to 
> just get the latest version?
> > 
> > Does no one automate tasks using ant and svn?  The svn-ant 
> tasks seem somewhat less mature than I would have expected.  
> > 
> > If I was using maven to do my building would I find better support?
> > 
> > 
> > Thank you,
> > 
> > Fu-Tung
> > 
> > 
> >       
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
> > 
> > 
> --
> ----------------------
> Mark S. Reibert, Ph.D.
> mark@reibert.com
> ----------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: svn-ant how to get latest revision?

Posted by Mark Reibert <ma...@reibert.com>.
Use svn info on the repository itself (not your working copy). Something
like:

svn info $( svn info | grep 'Root:' | awk -F': ' '{print $2}' ) \
    | grep Revision | awk '{print $2}'


On Tue, 2008-09-09 at 23:54 -0700, Fu-Tung Cheng wrote:
> Hi,
> 
> I am trying to figure out which command I can use from svn-ant that will get me the highest revision from the repository.  
> 
> I've tried svn-info but both the rev and lastRev properties return the working copies revision number.
> 
> I've also tried the wcVersion task but again that just tells you the working copies last revision.
> 
> In order for me to get the information it appears I need to update my working copy to the latest and then call one of these targets.  Shouldn't there be a way using svn-ant to just get the latest version?
> 
> Does no one automate tasks using ant and svn?  The svn-ant tasks seem somewhat less mature than I would have expected.  
> 
> If I was using maven to do my building would I find better support?
> 
> 
> Thank you,
> 
> Fu-Tung
> 
> 
>       
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> 
-- 
----------------------
Mark S. Reibert, Ph.D.
mark@reibert.com
----------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: RE: svn-ant how to get latest revision?

Posted by John Niven <jn...@bravurasolutions.com>.
> -----Original Message-----
> From: John Niven [mailto:jniven@bravurasolutions.com] 
> Sent: Thursday, 11 September 2008 17:38
> To: users@subversion.tigris.org
> Subject: RE: svn-ant how to get latest revision?
> 
> > -----Original Message-----
> > From: Fu-Tung Cheng [mailto:futung.cheng@yahoo.com]
> > Sent: Wednesday, 10 September 2008 18:55
> > To: users@subversion.tigris.org; user@ant.apache.org
> > Subject: svn-ant how to get latest revision?
> > 
> > Hi,
> > 
> > I am trying to figure out which command I can use from svn-ant that 
> > will get me the highest revision from the repository.
> > 
> > I've tried svn-info but both the rev and lastRev properties 
> return the 
> > working copies revision number.
> > 
> > I've also tried the wcVersion task but again that just 
> tells you the 
> > working copies last revision.
> > 
> > In order for me to get the information it appears I need to 
> update my 
> > working copy to the latest and then call one of these targets.  
> > Shouldn't there be a way using svn-ant to just get the 
> latest version?

I've just read your follow up message on user@ant.apache.org; you want
the rev number so that you can recreate the build at some future point.
This is a common use case for any SCM system.  Typically you would label
- or tag - the source tree - and that's exactly what I'd propose in SVN.
Create a tag, and then run your build off the tag.  Typically the tag
and the final artefact would have related names.

For example, assuming a Java JAR is the expected artefact, your Ant
build script would:
(a) SVN copy the contents of /trunk to /tags/build_2008-09-11_1745
(say);
(b) Use the Java source in /tags/build_2008-09-11_1745 to compile class
files and assemble a JAR;
(c) rename the JAR to product_2008-09-11_1745 and copy it to a
distribution directory.

If you needed to recreate that build's JAR at some future point you'd
simply re-run the Ant build script, but configure it to skip step (a).

Cheers
John

> > 
> > Does no one automate tasks using ant and svn?  The svn-ant 
> tasks seem 
> > somewhat less mature than I would have expected.
> 
> Your question isn't really on-topic for 
> users@subversion.tigris.org (or
> user@ant.apache.org) - you would probably get a better 
> response from users@subclipse.tigris.org (SvnAnt being part 
> of the Subclipse project, not SVN itself and certainly not Ant).
> 
> I understand that SvnAnt has been without an active 
> maintainer for some time, but that that has now changed:
> http://svn.haxx.se/subdev/archive-2008-08/0022.shtml - 
> version 1.2.0-RC1, targetting SVN 1.5, was released very 
> recently.  I noticed a few wrinkles in it ("svn copy 
> --parents" isn't fully implemented, for example), but 
> otherwise it's an improvement on 1.1.0.RC2.
> 
> You might also want to take a look at SvnKit - it's a pure 
> Java implementation of SVN and it looks (I've not tried it) 
> trivial to use from Ant using the "java" task.  To my mind 
> SvnKit seems easier to use for someone who's familiar with 
> SVN, and arguably more powerful.  That said, I've always 
> found SvnAnt does whatever I need it to, with very little 
> hacking required.
> 
> Cheers
> John
> 
> > 
> > If I was using maven to do my building would I find better support?
> > 
> > 
> > Thank you,
> > 
> > Fu-Tung
> > 
> > 
> >       
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: users-help@subversion.tigris.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


RE: svn-ant how to get latest revision?

Posted by John Niven <jn...@bravurasolutions.com>.
> -----Original Message-----
> From: Fu-Tung Cheng [mailto:futung.cheng@yahoo.com] 
> Sent: Wednesday, 10 September 2008 18:55
> To: users@subversion.tigris.org; user@ant.apache.org
> Subject: svn-ant how to get latest revision?
> 
> Hi,
> 
> I am trying to figure out which command I can use from 
> svn-ant that will get me the highest revision from the repository.  
> 
> I've tried svn-info but both the rev and lastRev properties 
> return the working copies revision number.
> 
> I've also tried the wcVersion task but again that just tells 
> you the working copies last revision.
> 
> In order for me to get the information it appears I need to 
> update my working copy to the latest and then call one of 
> these targets.  Shouldn't there be a way using svn-ant to 
> just get the latest version?
> 
> Does no one automate tasks using ant and svn?  The svn-ant 
> tasks seem somewhat less mature than I would have expected.  

Your question isn't really on-topic for users@subversion.tigris.org (or
user@ant.apache.org) - you would probably get a better response from
users@subclipse.tigris.org (SvnAnt being part of the Subclipse project,
not SVN itself and certainly not Ant).

I understand that SvnAnt has been without an active maintainer for some
time, but that that has now changed:
http://svn.haxx.se/subdev/archive-2008-08/0022.shtml - version
1.2.0-RC1, targetting SVN 1.5, was released very recently.  I noticed a
few wrinkles in it ("svn copy --parents" isn't fully implemented, for
example), but otherwise it's an improvement on 1.1.0.RC2.

You might also want to take a look at SvnKit - it's a pure Java
implementation of SVN and it looks (I've not tried it) trivial to use
from Ant using the "java" task.  To my mind SvnKit seems easier to use
for someone who's familiar with SVN, and arguably more powerful.  That
said, I've always found SvnAnt does whatever I need it to, with very
little hacking required.

Cheers
John

> 
> If I was using maven to do my building would I find better support?
> 
> 
> Thank you,
> 
> Fu-Tung
> 
> 
>       
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: svn-ant how to get latest revision?

Posted by Mark Reibert <ma...@reibert.com>.
Use svn info on the repository itself (not your working copy). Something
like:

svn info $( svn info | grep 'Root:' | awk -F': ' '{print $2}' ) \
    | grep Revision | awk '{print $2}'


On Tue, 2008-09-09 at 23:54 -0700, Fu-Tung Cheng wrote:
> Hi,
> 
> I am trying to figure out which command I can use from svn-ant that will get me the highest revision from the repository.  
> 
> I've tried svn-info but both the rev and lastRev properties return the working copies revision number.
> 
> I've also tried the wcVersion task but again that just tells you the working copies last revision.
> 
> In order for me to get the information it appears I need to update my working copy to the latest and then call one of these targets.  Shouldn't there be a way using svn-ant to just get the latest version?
> 
> Does no one automate tasks using ant and svn?  The svn-ant tasks seem somewhat less mature than I would have expected.  
> 
> If I was using maven to do my building would I find better support?
> 
> 
> Thank you,
> 
> Fu-Tung
> 
> 
>       
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 
> 
-- 
----------------------
Mark S. Reibert, Ph.D.
mark@reibert.com
----------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: svn-ant how to get latest revision?

Posted by Fu-Tung Cheng <fu...@yahoo.com>.
Thanks for the reply.

You are correct you can checkout using the "HEAD" tag.  This doesn't fulfill my requirements.

What I am trying to do is to create a build with the latest but also save the version number of each module in the build so that I could reproduce this build again in the future.  Obviously saving "head" isn't going to allow me to do this.

This is useful if you create builds for customers and later want to re-create that same build from source maybe you want to debug against that particular version.  Maybe you just need to send them a patch for that version instead of giving them a whole new release.  There are lots of reasons to do this.

So far using the ant targets the only way I've been able to do this is to
- do an update to head on all my modules
- get the working copy version numbers, save those number
- do another full checkout with those version numbers

The full checkout is necessary to avoid local changes being put into my build.  I'd prefer is my workflow was:

- get the svn latest version for all the modules
- do a full checkout using those versions

Thank you,

Fu-Tung




--- On Wed, 9/10/08, Grzegorz Słowikowski <gs...@gmail.com> wrote:

> From: Grzegorz Słowikowski <gs...@gmail.com>
> Subject: Re: svn-ant how to get latest revision?
> To: "Ant Users List" <us...@ant.apache.org>
> Date: Wednesday, September 10, 2008, 9:07 AM
> Hi
> 
> This is fragment from my script:
> 
>       <svn username="${user}"
> password="${pass}">
>         <checkout url="${srcurl}/${module}"
> revision="${revision}" 
> destPath="${checkout.dir}"
> recurse="${recurse}" />
>       </svn>
> 
> Use "HEAD" value for "${revision}" for
> latest version.
> Svn tasks are doing their job fine in my opinion, no need
> for Maven.
> 
> Grzegorz Slowikowski
> 
> Fu-Tung Cheng wrote:
> > Hi,
> >
> > I am trying to figure out which command I can use from
> svn-ant that will get me the highest revision from the
> repository.  
> >
> > I've tried svn-info but both the rev and lastRev
> properties return the working copies revision number.
> >
> > I've also tried the wcVersion task but again that
> just tells you the working copies last revision.
> >
> > In order for me to get the information it appears I
> need to update my working copy to the latest and then call
> one of these targets.  Shouldn't there be a way using
> svn-ant to just get the latest version?
> >
> > Does no one automate tasks using ant and svn?  The
> svn-ant tasks seem somewhat less mature than I would have
> expected.  
> >
> > If I was using maven to do my building would I find
> better support?
> >
> >
> > Thank you,
> >
> > Fu-Tung
> >
> >
> >       
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> user-help@ant.apache.org
> >
> >
> >   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


      


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Unzip task question

Posted by Hans Schwaebli <ha...@yahoo.com>.
Thank you. I will try this.


--- On Wed, 9/10/08, Stefan Bodewig <bo...@apache.org> wrote:
From: Stefan Bodewig <bo...@apache.org>
Subject: Re: Unzip task question
To: user@ant.apache.org
Date: Wednesday, September 10, 2008, 8:44 AM

On Wed, 10 Sep 2008, Hans Schwaebli <ha...@yahoo.com> wrote:

> I want to unzip a part of the zip file.
> 
> For example in the zipfile there are these folders:
> 
> -a
>  -b
>  -c
>  -d
>   -e
>  -f
> 
> I want just folder "e" to export. But if I do, then it creates
the
> whole structure in the output folder:
> 
> -a
>  -d
>   -e
> 
> I use:
> 
>         <unzip src="zipfile.zip"
dest="c:/tmp">
>             <patternset>
>                 <include
name="/**/e/**/*"/>
>             </patternset>
>         </unzip>
> 
> Moving and deleting folders afterwards is a workaround. Is there any
> real solution in Ant for this?


Yes, add a mapper to the task, something like (untested)

<unzip src="zipfile.zip" dest="c:/tmp">
  <patternset>
    <include name="/**/e/**/*"/>
  </patternset>
  <regexpmapper from=".*/e/(.*)" to="e/\1"/>
</unzip>

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org




      

Re: Unzip task question

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 10 Sep 2008, Hans Schwaebli <ha...@yahoo.com> wrote:

> I want to unzip a part of the zip file.
> 
> For example in the zipfile there are these folders:
> 
> -a
>  -b
>  -c
>  -d
>   -e
>  -f
> 
> I want just folder "e" to export. But if I do, then it creates the
> whole structure in the output folder:
> 
> -a
>  -d
>   -e
> 
> I use:
> 
>         <unzip src="zipfile.zip" dest="c:/tmp">
>             <patternset>
>                 <include name="/**/e/**/*"/>
>             </patternset>
>         </unzip>
> 
> Moving and deleting folders afterwards is a workaround. Is there any
> real solution in Ant for this?


Yes, add a mapper to the task, something like (untested)

<unzip src="zipfile.zip" dest="c:/tmp">
  <patternset>
    <include name="/**/e/**/*"/>
  </patternset>
  <regexpmapper from=".*/e/(.*)" to="e/\1"/>
</unzip>

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Unzip task question

Posted by Hans Schwaebli <ha...@yahoo.com>.
I want to unzip a part of the zip file.

For example in the zipfile there are these folders:

-a
 -b
 -c
 -d
  -e
 -f

I want just folder "e" to export. But if I do, then it creates the whole structure in the output folder:

-a
 -d
  -e

I use:

        <unzip src="zipfile.zip" dest="c:/tmp">
            <patternset>
                <include name="/**/e/**/*"/>
            </patternset>
        </unzip>

Moving and deleting folders afterwards is a workaround. Is there any real solution in Ant for this?



      

Re: svn-ant how to get latest revision?

Posted by Grzegorz Słowikowski <gs...@gmail.com>.
Hi

This is fragment from my script:

      <svn username="${user}" password="${pass}">
        <checkout url="${srcurl}/${module}" revision="${revision}" 
destPath="${checkout.dir}" recurse="${recurse}" />
      </svn>

Use "HEAD" value for "${revision}" for latest version.
Svn tasks are doing their job fine in my opinion, no need for Maven.

Grzegorz Slowikowski

Fu-Tung Cheng wrote:
> Hi,
>
> I am trying to figure out which command I can use from svn-ant that will get me the highest revision from the repository.  
>
> I've tried svn-info but both the rev and lastRev properties return the working copies revision number.
>
> I've also tried the wcVersion task but again that just tells you the working copies last revision.
>
> In order for me to get the information it appears I need to update my working copy to the latest and then call one of these targets.  Shouldn't there be a way using svn-ant to just get the latest version?
>
> Does no one automate tasks using ant and svn?  The svn-ant tasks seem somewhat less mature than I would have expected.  
>
> If I was using maven to do my building would I find better support?
>
>
> Thank you,
>
> Fu-Tung
>
>
>       
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: svn-ant how to get latest revision?

Posted by Mark Reibert <sv...@reibert.com>.
Use svn info on the repository itself (not your working copy). Something
like:

svn info $( svn info | grep 'Root:' | awk -F': ' '{print $2}' ) \
    | grep Revision | awk '{print $2}'


On Tue, 2008-09-09 at 23:54 -0700, Fu-Tung Cheng wrote:
> Hi,
> 
> I am trying to figure out which command I can use from svn-ant that will get me the highest revision from the repository.  
> 
> I've tried svn-info but both the rev and lastRev properties return the working copies revision number.
> 
> I've also tried the wcVersion task but again that just tells you the working copies last revision.
> 
> In order for me to get the information it appears I need to update my working copy to the latest and then call one of these targets.  Shouldn't there be a way using svn-ant to just get the latest version?
> 
> Does no one automate tasks using ant and svn?  The svn-ant tasks seem somewhat less mature than I would have expected.  
> 
> If I was using maven to do my building would I find better support?
> 
> 
> Thank you,
> 
> Fu-Tung
> 
> 
>       
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 

-- 
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn-ant how to get latest revision?

Posted by Mark Reibert <sv...@reibert.com>.
Use svn info on the repository itself (not your working copy). Something
like:

svn info $( svn info | grep 'Root:' | awk -F': ' '{print $2}' ) \
    | grep Revision | awk '{print $2}'


On Tue, 2008-09-09 at 23:54 -0700, Fu-Tung Cheng wrote:
> Hi,
> 
> I am trying to figure out which command I can use from svn-ant that will get me the highest revision from the repository.  
> 
> I've tried svn-info but both the rev and lastRev properties return the working copies revision number.
> 
> I've also tried the wcVersion task but again that just tells you the working copies last revision.
> 
> In order for me to get the information it appears I need to update my working copy to the latest and then call one of these targets.  Shouldn't there be a way using svn-ant to just get the latest version?
> 
> Does no one automate tasks using ant and svn?  The svn-ant tasks seem somewhat less mature than I would have expected.  
> 
> If I was using maven to do my building would I find better support?
> 
> 
> Thank you,
> 
> Fu-Tung
> 
> 
>       
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 

-- 
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org