Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Modules/getbuildinfo.c

    r2 r388  
    2929#endif
    3030
     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
    3142const char *
    3243Py_GetBuildInfo(void)
    3344{
    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;
    4257}
    4358
     
    4560_Py_svnversion(void)
    4661{
    47         /* the following string can be modified by subwcrev.exe */
    48         static const char svnversion[] = SVNVERSION;
    49         if (svnversion[0] != '$')
    50                 return svnversion; /* it was interpolated, or passed on command line */
    51         return "Unversioned directory";
     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";
    5267}
     68
     69const char *
     70_Py_hgversion(void)
     71{
     72    return HGVERSION;
     73}
     74
     75const 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.