1

I want to get the latest svn revision number using coldfusion. Any idea how?

nasaa
  • 2,701
  • 8
  • 47
  • 76

2 Answers2

2

You still have to parse the results, like this: (May vary depending on your SVN app and whether on Windows or Linux)

<cfexecute name="c:\Program Files\SlikSvn\bin\svn.exe" timeout="30"
            arguments="--username myusername --password mypassword info ""c:\inetpub\mysite\"""
            variable="res"></cfexecute>

<cfset a = listToArray(res,chr(10))>


<cfset rev=0>
<cfloop array="#a#" index="i">
    <cfset info = listToArray(i,":")>
    <cfif info[1] eq "Last Changed Rev">
            <cfset rev=trim(info[2])>
    </cfif>
</cfloop>

<cfoutput>#rev#</cfoutput>
Billy Cravens
  • 1,643
  • 10
  • 15
0
<cfset workcopyPath = "[path to svn working copy]">
<cfset svnPath = "[path to svn executable]">
<cfset svnArg = " info #workcopyPath#">

<cfexecute name="#svnPath#"
           arguments="#svnArg#"
           timeout="10"
           variable="svnInfoResult">

<cfdump var=#svnInfoResult#>

http://www.coldfusionjedi.com/index.cfm/2006/12/9/ColdFsion-handling-of-Subversion-events

http://www.numtopia.com/terry/blog/archives/2008/02/using_coldfusion_and_svn_to_create_release_notes.cfm

Henry
  • 32,689
  • 19
  • 120
  • 221
  • I found this article here and it explains everything very well - http://obligious.blogspot.com/2011/12/you-can-access-svn-information-from.html – nasaa Dec 20 '11 at 19:39