Ticket #3546: 3546.patch

File 3546.patch, 2.5 KB (added by Wiktor Walc, 15 years ago)
  • _source/includes/ckreleaser.js

     
    1212        verbose : 0,
    1313        os : System.getProperty( "os.name" ).substring( 0, 3 ).toLowerCase(),
    1414        path : "",
     15        revisionNumber : 0,
    1516
    1617        timestamp : ( function()
    1718        {
  • _source/includes/releaser.js

     
    254254                }
    255255                if ( text.indexOf( "%REV%" ) != -1 )
    256256                {
    257                         var o =
     257                        if ( !CKRELEASER.revisionNumber )
    258258                        {
    259                                 output : ""
    260                         };
     259                                try
     260                                {
     261                                        var o =
     262                                        {
     263                                                        output : ""
     264                                        };
    261265
    262                         runCommand( "svn", "info", CKRELEASER.sourceDir, o );
     266                                        runCommand( "svn", "info", CKRELEASER.sourceDir, o );
    263267
    264                         if ( o.output.indexOf( "Revision:" ) != -1 )
    265                         {
    266                                 var rev = regexLib.packagerRev.matcher( o.output ).replaceAll( '$1' );
    267                                 text = text.replace( /%REV%/g, rev );
     268                                        if ( o.output.indexOf( "Revision:" ) != -1 )
     269                                        {
     270                                                CKRELEASER.revisionNumber = regexLib.packagerRev.matcher( o.output ).replaceAll( '$1' );
     271                                        }
     272                                        else
     273                                        {
     274                                                if ( o.output.indexOf( "not a working" ) != -1 )
     275                                                        print( "\nWARNING: Unable to fetch the revision number, source directory is not under version control: "
     276                                                                        + CKRELEASER.sourceDir );
     277                                                else
     278                                                        print( "\nWARNING: Unable to fetch the revision number, make sure that Subversion's bin directory is in your system path." );           
     279                                        }
     280                                }
     281                                catch( e )
     282                                {
     283                                        print( "\nWARNING: Unable to run \"svn\" command to get the revision number, make sure that Subversion is installed and that Subversion's bin directory is in your system path." );
     284                                }
     285                               
     286                                if ( !CKRELEASER.revisionNumber )
     287                                        CKRELEASER.revisionNumber = "UNKNOWN";
    268288                        }
    269                         else
    270                         {
    271                                 if ( o.output.indexOf( "not a working" ) != -1 )
    272                                         print( "WARNING: Unable to fetch the revision number, source directory is not under version control: "
    273                                                         + CKRELEASER.sourceDir );
    274                                 else
    275                                         print( "WARNING: Unable to fetch the revision number, make sure that Subversion’s bin directory is in your system path." );
    276                                 text = text.replace( /%REV%/g, "UNKNOWN" );
    277                         }
    278289
     290                        text = text.replace( /%REV%/g, CKRELEASER.revisionNumber );
     291
    279292                        replaced = true;
    280293                }
    281294                if ( text.indexOf( "%TIMESTAMP%" ) != -1 )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy