Archive for June, 2005

June 27, 2005

CruiseControl.NET and Subversion Revision Numbers using NAnt

A while ago, I posted a simple stop-gap solution for retrieving Subversion revision numbers during a CruiseControl.NET build, and had hoped that functionality would shortly make it into a release.  Well, it hasn’t, and I have had to revisit this recently.  Here’s a better solution than the original (using Subversion 1.2.0):

  <echo message="Retrieving Subversion revision number"/>
  <property name="svn.revision" value="00"/>
    <exec
          program="svn.exe"
         commandline=’log "${project::get-base-directory()}" –xml –limit 1′
          output="_revision.xml"
          failonerror="false"/>
    <xmlpeek
          file="_revision.xml"
          xpath="/log/logentry/@revision"
          property="svn.revision"
          failonerror="false"/>
   <echo message="Using Subversion revision number: ${svn.revision}"/>

A little more generic, and much closer to the point–this one does a better job of getting the appropriate Subversion revision number.

June 24, 2005

Modified Subversion 1.2.0 binaries to work with “_svn” (with a twist)

I decided to try something a little different this time, in the hopes of coming up with a solution that puts an end to this pain. From the README.txt:

I made a slightly different change to this mod–instead of defaulting to “_svn”, this build defaults to “.svn” unless it finds an environment variable named “SVN_ADM_DIR”, in which case that value is used for the svn admin directory. For example, to have svn_mod.exe use the working directory “_svn” to do a log, you would do the following:

set SVN_ADM_DIR=_svn
svn_mod log [path]

To change it back again, and use “.svn” (which is the default if no env variable is found), either :

set SVN_ADM_DIR=
svn_mod log [path]

or

set SVN_ADM_DIR=.svn
svn_mod log [path]

I made this change by defining SVN_WC_ADM_DIR_NAME differently (instead of the usual “_svn”):

#define SVN_WC_ADM_DIR_NAME ( ( getenv( “SVN_ADM_DIR”) ) ? ( getenv( “SVN_ADM_DIR”) ) : (“.svn”) )

Note this means you can set the svn admin directory to whatever you want to set it to. I have proposed this change to the dev list, perhaps they’ll use it or come up with a better idea so I can uninstall python from my machine…

So I have to wait and see what the mockery response is. In the meantime, feel free to download the change here:

Subversion Modified (“_svn“ support with a twist) (Executables Only) ver. 1.2.0: download

Note, these are ONLY the executables. You need to have a proper install of Subversion 1.2.0 before copying these files (place them in the same bin directory as the 1.2.0 binaries). These were renamed *-mod.exe, so there will be no conflict. Use at your own risk, but please let me know if there are any issues.

Follow

Get every new post delivered to your Inbox.