Is there a way use the svn ant task to get the svn revision number of a working copy and put it into a variable?
I would like to add an entry in my Java manifest file which includes the svn revision number, e.g. 0.9.65361
where 65361
is the revision number.
Specify the subversion repository URL to check out, such as "https://svn.apache.org/repos/asf/ant/". You can also add "@NNN" at the end of the URL to check out a specific revision number, if that's desirable.
By far the easiest way to revert the changes from one or more revisions, is to use the revision log dialog. Select the file or folder in which you need to revert the changes. If you want to revert all changes, this should be the top level folder. Select TortoiseSVN → Show Log to display a list of revisions.
Unlike most version control systems, Subversion's revision numbers apply to the entire repository tree, not individual files. Each revision number selects an entire tree, a particular state of the repository after some committed change.
Every time you commit a set of changes, you create one new “revision” in the repository. Each revision represents the state of the repository tree at a certain point in its history. If you want to go back in time you can examine the repository as it was at revision N.
Aha, I found this idea, which depends only on the svnversion
command-line utility in SVN.
<project name="ant-exec-example" default="svnversion" basedir=".">
<target name="svnversion">
<exec executable="svnversion" outputproperty="svnversion" />
<echo message="SVN Version: ${svnversion}"/>
</target>
</project>
Here's where it captures the version in an ant property:
<exec executable="svnversion" outputproperty="svnversion" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With