Changeset 388 for python/vendor/current/Modules/getbuildinfo.c
- Timestamp:
- Mar 19, 2014, 11:11:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/vendor/current/Modules/getbuildinfo.c
r2 r388 29 29 #endif 30 30 31 /* XXX Only unix build process has been tested */ 32 #ifndef HGVERSION 33 #define HGVERSION "" 34 #endif 35 #ifndef HGTAG 36 #define HGTAG "" 37 #endif 38 #ifndef HGBRANCH 39 #define HGBRANCH "" 40 #endif 41 31 42 const char * 32 43 Py_GetBuildInfo(void) 33 44 { 34 static char buildinfo[50]; 35 const char *revision = Py_SubversionRevision(); 36 const char *sep = *revision ? ":" : ""; 37 const char *branch = Py_SubversionShortBranch(); 38 PyOS_snprintf(buildinfo, sizeof(buildinfo), 39 "%s%s%s, %.20s, %.9s", branch, sep, revision, 40 DATE, TIME); 41 return buildinfo; 45 static char buildinfo[50 + sizeof(HGVERSION) + 46 ((sizeof(HGTAG) > sizeof(HGBRANCH)) ? 47 sizeof(HGTAG) : sizeof(HGBRANCH))]; 48 const char *revision = _Py_hgversion(); 49 const char *sep = *revision ? ":" : ""; 50 const char *hgid = _Py_hgidentifier(); 51 if (!(*hgid)) 52 hgid = "default"; 53 PyOS_snprintf(buildinfo, sizeof(buildinfo), 54 "%s%s%s, %.20s, %.9s", hgid, sep, revision, 55 DATE, TIME); 56 return buildinfo; 42 57 } 43 58 … … 45 60 _Py_svnversion(void) 46 61 { 47 48 49 50 51 62 /* the following string can be modified by subwcrev.exe */ 63 static const char svnversion[] = SVNVERSION; 64 if (svnversion[0] != '$') 65 return svnversion; /* it was interpolated, or passed on command line */ 66 return "Unversioned directory"; 52 67 } 68 69 const char * 70 _Py_hgversion(void) 71 { 72 return HGVERSION; 73 } 74 75 const char * 76 _Py_hgidentifier(void) 77 { 78 const char *hgtag, *hgid; 79 hgtag = HGTAG; 80 if ((*hgtag) && strcmp(hgtag, "tip") != 0) 81 hgid = hgtag; 82 else 83 hgid = HGBRANCH; 84 return hgid; 85 }
Note:
See TracChangeset
for help on using the changeset viewer.