Skip to content

Instantly share code, notes, and snippets.

@aeurielesn
Created August 4, 2011 05:24
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aeurielesn/1124550 to your computer and use it in GitHub Desktop.
Save aeurielesn/1124550 to your computer and use it in GitHub Desktop.
ant script to get local revision number from the subversion's .svn/entries file
<?xml version="1.0" encoding="UTF-8"?>
<project name="svn" default="revision-number" basedir=".">
<target name="check-svn-entries">
<available file=".svn/entries" property="svn.entries.present"/>
</target>
<target name="revision-number" depends="check-svn-entries" if="svn.entries.present">
<loadfile srcfile=".svn/entries" property="revision">
<filterchain>
<headfilter lines="1" skip="3"/>
</filterchain>
</loadfile>
<echo file="REVISION" message="${revision}"/>
</target>
</project>
@centic9
Copy link

centic9 commented May 22, 2014

This seems to not work any more with SVN 1.7, the file entries contains "12", but I have a revision around 400000...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment