Community
Participate
Working Groups
hi The SVN_REVISION environment variable does not seem to be set when using @HEAD in a Subversion URL. Try to run the "echo.properties" Ant target below using Hudson. --- <?xml version="1.0" encoding="windows-1252" ?> <project name="SomeSVNRevisionProject" default="" basedir="."> <property environment="env"/> <target name="echo.properties"> <echo message="env.SVN_REVISION = ${env.SVN_REVISION}"/> </target> </project> --- Using a Subersion URL without @HEAD suffix the console output is: --- Started by user anonymous Updating file:///D:/temp/some-repository/trunk revision: Jun 16, 2013 7:27:30 PM depth:infinity ignoreExternals: false At revision 2 no change for file:///D:/temp/some-repository/trunk since the previous build [temp] $ cmd.exe /C '"C:\oracle\jdevstudio111230-mw\jdeveloper\ant\bin\ant.bat -buildfile D:/temp/build.xml echo.properties && exit %%ERRORLEVEL%%"' Buildfile: D:\temp\build.xml echo.properties: [echo] env.SVN_REVISION = 2 BUILD SUCCESSFUL Total time: 0 seconds Finished: SUCCESS --- Using a Subersion URL with @HEAD suffix the console output is: --- Started by user anonymous Updating file:///D:/temp/some-repository/trunk@HEAD revision: HEAD depth:infinity ignoreExternals: false At revision 2 no change for file:///D:/temp/some-repository/trunk since the previous build [temp] $ cmd.exe /C '"C:\oracle\jdevstudio111230-mw\jdeveloper\ant\bin\ant.bat -buildfile D:/temp/build.xml echo.properties && exit %%ERRORLEVEL%%"' Buildfile: D:\temp\build.xml echo.properties: [echo] env.SVN_REVISION = ${env.SVN_REVISION} BUILD SUCCESSFUL Total time: 0 seconds Finished: SUCCESS --- I would expect the SVN_REVISION environment variable to always be set, regardless the use of @HEAD in a Subversion URL. (seems related to https://issues.jenkins-ci.org/browse/JENKINS-10942 ) many thanks Jan Vervecken
I see another case of SVN_REVISION not exported, If I have a port specified in a svn URL is doesn't get a revision. I think is has something todo with the .svn files on disk doesn't have the port hence there is a mismacth svn://scrbpwmdefrm612/MLT-DEV/... works svn://scrbpwmdefrm612:3690/MLT-DEV/... does not export SVN_REVISION