I want to get the latest svn revision number using coldfusion. Any idea how?
Asked
Active
Viewed 285 times
1
-
possible duplicate of [Getting the last revision number in SVN?](http://stackoverflow.com/questions/579196/getting-the-last-revision-number-in-svn) – Henry Nov 18 '11 at 17:48
-
did you mean
– nasaa Nov 18 '11 at 18:01
2 Answers
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

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