[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Subclipse-dev] svnAnt and

From: Matt Doran <matt.doran_at_papercut.biz>
Date: 2005-08-06 07:57:32 CEST

Daniel Rall <dlr <at> finemaltcoding.com> writes:

> Daniel, it appears that 'svn info' is completely missing from SvnAnt.
> As svnClientAdapter does support this function, adding this feature to
> SvnAnt should be fairly trivial. This will happen post-1.0.0. If
> you're up for submitting a patch, that would be fantastic (just use of
> the existing commands as a template), but if you'd at least file an
> issue and CC the Tigris user 'dlr', that would also be a big help.
>
> In the mean time, you can either:
> 1) Try SvnAnt's equivalent of 'svn log' in conjunction with the special
> revision "BASE", and pull the revision number out of its output.
> 2) <exec> a 'svn info'.
> 3) Parse the content of .svn/ yourself.
> 4) Write a simple Ant Task which wraps ISVNInfo.
>
> Option 1 is obviously the simplest.
>
> - Dan
>

I also encountered this issue in our project. I wanted something that
would work a little like the tool that ships with SVN "svnversion" or the
TortoiseSVN tool called "SubWCRev". Both of these tools crawl the working
copy producing a summary of the WC status. Giving you infomation like max
revision, whether there are any modified files, the revision range if it's
a mixed working copy. These can then be used to create product version info,
etc. But they didn't really do what I wanted .... so I invented my own....

I wrote my own Ant Task (that depends on JavaSVN) that does the following:
* Crawl the working copy specified in the "path" property gathering
    the above info
* Output the info to various ant properties (with a customisable prefix)
    that can be used later in the build process.

Here's an example of the properties that would be set in a sample working
copy (with modifications):

svn.repos.url -> https://server/repos/branches/1.2.x
svn.repos.path -> /repos/branches/1.2.x
svn.revision.max -> 676
svn.revision.max-with-flags -> 676M
svn.revision.range -> 676M
svn.modified -> true

if it was a mixed and modified working copy the results would be like this:

svn.repos.url -> https://server/repos/branches/1.2.x
svn.repos.path -> /repos/branches/1.2.x
svn.revision.max -> 676
svn.revision.max-with-flags -> 676MX
svn.revision.range -> 673:676M
svn.modified -> true
svn.mixed -> true

I then use the and copy filters to include these properties in my build,
and name the output jars/installers with the numbers.

It's made including version/branch info in the build simple ... and allows
you to see at a glance if you made a build from modified sources ... which
is important for quality control ... and so you know exactly what you build
was made up of.

I've only really implemented this a few weeks ago ... but if people think
this type of thing is useful, I'm happy to take feedback, polish it up and
publish it for use somewhere..... or even to include in svnAnt (not that
I've even looked at that code).

Regards,

Matt
Received on Sat Aug 6 15:57:32 2005

This is an archived mail posted to the Subclipse Dev mailing list.