[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Build number into code? (was: Development practices using Subversion)

From: Ivan-Assen Ivanov <ivanassen_at_gmail.com>
Date: 2004-08-10 15:43:05 CEST

And here is the Windows version, in JScript. It is a function that
returns the highest revision number:

And here is the Windows version, in JScript. It returns the highest
revision number:

function FindMaxRevision()
{
       var cmd;
       var re = /Revision: (\d+)/
       var maxrev = 0;
       var rev;

       var fso = new ActiveXObject("Scripting.FileSystemObject");
       var WshShell = new ActiveXObject("WScript.Shell");
       var oExec;

       cmd = "svn info -R c:/working/copy";
       oExec = WshShell.Exec(cmd);
       while( !oExec.StdOut.AtEndOfStream ) {
                       var line = oExec.StdOut.ReadLine();
                       if( line.match(re) != null ) {
                               rev = RegExp.$1;
                               if( rev > maxrev ) {
                                       maxrev = rev;
                               }
                       }
       }
       while( oExec.Status == 0 ) {
               WScript.Sleep(100);
       }

       return maxrev;
}

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Aug 10 15:43:38 2004

This is an archived mail posted to the Subversion Users mailing list.