Ant svntask getting revision message

I am using ant with svntask to update the repository before I create the application. At the end of the build, a message is displayed with the build results. It would be very helpful to include the version number and svn message in this email, so if the build breaks, we know which revision will be reviewed.

Currently only the version number is displayed:

<status path="${main.site}" revisionProperty="sqlUpdateStatus.revision"/>

      

But I don't know how (or if there is a way) to get this revision message (the message entered by the committer). Do you guys know how to do this?

+2


source to share


6 answers


This is not exactly the answer to your question, but do you think you are using a continuous integration (CI) tool like Hudson ?



Hudson comes out of the box with SVN and ANT support and the ability to send email messages when a build fails.

+2


source


I don't think there is a built-in way to get the commit message, but you can pull it manually from svn with the following command:

svnlook log -r X /path/to/repo

      



This will return the log message for revision X for the repository at / path / to / repo. You can wrap this in an ant exec task to preform it from ant ...

+1 for Hudson - very easy to deploy and configure

+2


source


<svn username="username" password="password">
 <log url="svn://url"/>
</svn>

      

+1


source


I don't know how to do this with svnant, but a good way to get it from the command line is:

svn propget --revprop svn:log -r1234

      

+1


source


Using the executable:

<exec executable="svn" dir="." outputproperty="ant.comment">
     <arg line="propget --revprop svn:log -r${ant.revision}"/>
</exec>
<echo>The comment is: ${ant.comment}</echo>

      

+1


source


use the following command

svn propget --revprop svn:log -r HEAD --username USERNAME svn://THE_URL

      

+1


source







All Articles