Skip to content

Instantly share code, notes, and snippets.

@j4y
Created July 8, 2011 18:05
Show Gist options
  • Save j4y/1072391 to your computer and use it in GitHub Desktop.
Save j4y/1072391 to your computer and use it in GitHub Desktop.
ant script to get a cvs branch name from the CVS tag file
<project name="ant script to get a cvs branch name from the CVS tag file" basedir=".">
<loadfile property="cvs.tag" srcFile="CVS/Tag" failonerror="false">
<filterchain>
<striplinebreaks/>
<tokenfilter>
<replaceregex pattern="^T" replace="" />
<replaceregex pattern="^D.*" replace="HEAD" />
</tokenfilter>
</filterchain>
</loadfile>
<!-- default to HEAD if the Tag file is missing -->
<property name="cvs.tag" value="HEAD" />
<echo file="CVS_TAG">${cvs.tag}</echo>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment