diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-01-05 23:38:54 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-01-05 23:38:54 (GMT) |
commit | 43b57805fbc9b500f0b4239fd925868b26475f35 (patch) | |
tree | a51376847084539e13d75a840924da91864def77 /Modules | |
parent | 2b47445234bd44b1382cc434c408a390eb4aa07e (diff) | |
download | cpython-43b57805fbc9b500f0b4239fd925868b26475f35.zip cpython-43b57805fbc9b500f0b4239fd925868b26475f35.tar.gz cpython-43b57805fbc9b500f0b4239fd925868b26475f35.tar.bz2 |
Drop sys.build_number. Add sys.subversion.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/getbuildinfo.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c index 1ff061f..3312a87 100644 --- a/Modules/getbuildinfo.c +++ b/Modules/getbuildinfo.c @@ -20,32 +20,25 @@ #endif #endif -static const char revision[] = "$Revision$"; -static const char headurl[] = "$HeadURL$"; - const char * Py_GetBuildInfo(void) { static char buildinfo[50]; -#ifdef SVNVERSION - static char svnversion[50] = SVNVERSION; -#else - static char svnversion[50] = "exported"; -#endif - if (strcmp(svnversion, "exported") == 0 && - strstr(headurl, "/tags/") != NULL) { - int start = 11; - int stop = strlen(revision)-2; - strncpy(svnversion, revision+start, stop-start); - svnversion[stop-start] = '\0'; - } + char *revision = Py_SubversionRevision(); + char *sep = revision ? ":" : ""; + char *branch = Py_SubversionShortBranch(); PyOS_snprintf(buildinfo, sizeof(buildinfo), - "%s, %.20s, %.9s", svnversion, DATE, TIME); + "%s%s%s, %.20s, %.9s", branch, sep, revision, + DATE, TIME); return buildinfo; } const char * -Py_GetBuildNumber(void) +_Py_svnversion(void) { - return "0"; +#ifdef SVNVERSION + return SVNVERSION; +#else + return "exported"; +#endif } |