diff options
author | Georg Brandl <georg@python.org> | 2011-03-06 09:13:00 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2011-03-06 09:13:00 (GMT) |
commit | 13039c87f14aeed325bcb5fadd202922a614957b (patch) | |
tree | f78ce4e5acffdb796e9c1803a7b2127100f5fd4f /Modules | |
parent | 80d3610bc36e484fbe7b7ccce366a73314505a16 (diff) | |
parent | 8256242b30005b8a1b52e79149558ad36f1307d6 (diff) | |
download | cpython-13039c87f14aeed325bcb5fadd202922a614957b.zip cpython-13039c87f14aeed325bcb5fadd202922a614957b.tar.gz cpython-13039c87f14aeed325bcb5fadd202922a614957b.tar.bz2 |
Merge build identification to 3.2 branch.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/getbuildinfo.c | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c index 3bac1c5..c70126d 100644 --- a/Modules/getbuildinfo.c +++ b/Modules/getbuildinfo.c @@ -28,15 +28,28 @@ #define SVNVERSION "$WCRANGE$$WCMODS?M:$" #endif +/* XXX Only unix build process has been tested */ +#ifndef HGVERSION +#define HGVERSION "" +#endif +#ifndef HGTAG +#define HGTAG "" +#endif +#ifndef HGBRANCH +#define HGBRANCH "" +#endif + const char * Py_GetBuildInfo(void) { static char buildinfo[50]; - const char *revision = Py_SubversionRevision(); + const char *revision = _Py_hgversion(); const char *sep = *revision ? ":" : ""; - const char *branch = Py_SubversionShortBranch(); + const char *hgid = _Py_hgidentifier(); + if (!(*hgid)) + hgid = "default"; PyOS_snprintf(buildinfo, sizeof(buildinfo), - "%s%s%s, %.20s, %.9s", branch, sep, revision, + "%s%s%s, %.20s, %.9s", hgid, sep, revision, DATE, TIME); return buildinfo; } @@ -50,3 +63,21 @@ _Py_svnversion(void) return svnversion; /* it was interpolated, or passed on command line */ return "Unversioned directory"; } + +const char * +_Py_hgversion(void) +{ + return HGVERSION; +} + +const char * +_Py_hgidentifier(void) +{ + const char *hgtag, *hgid; + hgtag = HGTAG; + if ((*hgtag) && strcmp(hgtag, "tip") != 0) + hgid = hgtag; + else + hgid = HGBRANCH; + return hgid; +} |