Changeset 1208

Show
Ignore:
Timestamp:
12/05/08 09:16:38 (1 month ago)
Author:
bibo
Message:

ticket #762 : backport on branch 1.0.x. fixes Subversion::revision.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0.x/build/lib/jBuild.inc.php

    r418 r1208  
    172172class Subversion { 
    173173    static public function revision($path='.'){ 
    174         $path=jBuildUtils::normalizeDir($path).'.svn/entries'
     174        $path=jBuildUtils::normalizeDir($path)
    175175        $rev=-1; 
    176         if(file_exists($path)){ 
     176        if(file_exists($path.'.svn/entries')){ 
    177177            /* FIXME : namespace invalide dans les fichiers entries, on ne peut 
    178178              donc pas les lire à partir de simplxml ou dom 
    179179 
     180            $path = $path.'.svn/entries'; 
    180181            $svninfo = simplexml_load_file ( $path); 
    181182            if(isset($svninfo->entry[0])) 
    182183                $rev=$svninfo->entry[0]['revision']; 
    183184            */ 
    184             $rev=`svn info | grep -E "vision" -m 1`; 
    185             if(preg_match("/vision\s*:\s*(\d+)/",$rev, $m)) 
     185            $rev=`svnversion $path --no-newline`; 
     186            if(preg_match("/(\d+)[MS]+/",$rev, $m)) 
    186187                $rev=$m[1]; 
    187188        } 
Download in other formats: Unified Diff Zip Archive