| 37 | | #if 0 |
| 38 | | // first analyze the URL to determine where we live, the chVersion string is derived from that |
| 39 | | // the code below is based on the following naming scheme: |
| 40 | | // |
| 41 | | // /branches/c08_branch -- release branch, all bug fixes are submitted here |
| 42 | | // |
| 43 | | // /tags/develop/c08.01_rc1 -- release candidates go here |
| 44 | | // |
| 45 | | // /tags/release/c08.01 -- first official release |
| 46 | | // /tags/release/c08.02 -- first bug-fix rollup, etc... |
| 47 | | // |
| 48 | | // /tags/patch_versions/c08.01.00 -- identical to /tags/release/c08.01 |
| 49 | | // /tags/patch_versions/c08.01.01 -- first patch update, etc... |
| 50 | | // |
| 51 | | // /trunk -- this will be labeled as "exprimental" |
| 52 | | // /tags/stable -- ditto |
| 53 | | // /branches/* -- ditto, note that "*" can be anything except c??_branch |
| 54 | | |
| 55 | | vector<string> Part; |
| 56 | | Split( Url, "/", Part, SPM_RELAX ); |
| 57 | | if( Part.size() >= 3 ) |
| 58 | | { |
| 59 | | // the last two parts are "source" and "version.h $", we don't need them... |
| 60 | | // the one before is the name of the branch (e.g. "trunk", "newmole", "c08.01") |
| 61 | | string Branch = Part[Part.size()-3]; |
| 62 | | |
| 63 | | bool lgReleaseTag = ( Url.find("/tags/release/") != string::npos ); |
| 64 | | bool lgPatchTag = ( Url.find("/tags/patch_versions/") != string::npos ); |
| 65 | | bool lgDevelopTag = ( Url.find("/tags/develop/") != string::npos ); |
| 66 | | // this expects a branch name like "c08_branch" |
| 67 | | bool lgReleaseBranch = ( Url.find("/branches/") != string::npos && |
| 68 | | Branch.size() == 10 && Branch[0] == 'c' && |
| 69 | | Branch.find("_branch") != string::npos ); |
| 70 | | |
| 71 | | lgRelease = ( lgReleaseTag || lgPatchTag ); |
| 72 | | |
| 73 | | // determine if this is a beta version |
| 74 | | string::size_type ptr; |
| 75 | | if( lgDevelopTag && ( ptr = Branch.find( "_rc" ) ) != string::npos ) |
| 76 | | // this expects a branch name like "c08.01_rc1" |
| 77 | | sscanf( Branch.substr( ptr+3 ).c_str(), "%ld", &nBetaVer ); |
| 78 | | else |
| 79 | | nBetaVer = 0; |
| 80 | | |
| 81 | | int nPatchLevel; |
| 82 | | if( lgPatchTag ) |
| 83 | | // this expects a branch name like "c08.01.02" |
| 84 | | sscanf( Branch.substr( Branch.size()-2 ).c_str(), "%d", &nPatchLevel ); |
| 85 | | else |
| 86 | | nPatchLevel = 0; |
| 87 | | |
| 88 | | if( lgReleaseTag ) |
| 89 | | // this expects a branch name like "c08.01" |
| 90 | | strncpy( chVersion, Branch.substr(1).c_str(), INPUT_LINE_LENGTH ); |
| 91 | | else if( lgPatchTag ) |
| 92 | | // this expects a branch name like "c08.01.02" |
| 93 | | sprintf( chVersion, "%s (patch level %d)", Branch.substr(1,5).c_str(), nPatchLevel ); |
| 94 | | else if( nBetaVer > 0 ) |
| 95 | | // this expects a branch name like "c08.01_rc1" |
| 96 | | sprintf( chVersion, "%s beta %ld (prerelease)", Branch.substr(1,5).c_str(), nBetaVer ); |
| 97 | | else if( lgReleaseBranch ) |
| 98 | | // this expects a branch name like "c08_branch" |
| 99 | | sprintf( chVersion, "(prerelease, %s, ver. %s)", Branch.c_str(), svn_revision ); |
| 100 | | else |
| 101 | | // the branch name can be anything except "c??_branch" |
| 102 | | sprintf( chVersion, "(experimental, %s, ver. %s)", Branch.c_str(), svn_revision ); |
| 103 | | } |
| 104 | | else |
| 105 | | { |
| 106 | | // create a default version string in case HeadURL was not expanded |
| 107 | | |
| 108 | | /* is this a release version? */ |
| 109 | | lgRelease = false; |
| 110 | | |
| 111 | | /* is this a beta version? 0 for no */ |
| 112 | | nBetaVer = 0; |
| 113 | | |
| 114 | | sprintf( chVersion, "%2.2i%2.2i%2.2i", YEAR%100, MONTH+1, DAY ); |
| 115 | | } |
| 116 | | #else |