From 43b57805fbc9b500f0b4239fd925868b26475f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Thu, 5 Jan 2006 23:38:54 +0000 Subject: Drop sys.build_number. Add sys.subversion. --- Modules/getbuildinfo.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'Modules/getbuildinfo.c') diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c index 1ff061f99d..3312a87c2b 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 } -- cgit v1.2.1