在coldfusion中显示SVN修订号

时间:2011-11-18 17:41:53

标签: svn coldfusion

我想使用coldfusion获取最新的svn版本号。知道怎么样?

2 个答案:

答案 0 :(得分:2)

您仍然需要解析结果,如下所示: (可能会因您的SVN应用程序而异,无论是在Windows还是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>

答案 1 :(得分: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