◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
4 changes: 3 additions & 1 deletion Lib/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,9 @@ def _sys_version(sys_version=None):
elif buildtime:
builddate = builddate + ' ' + buildtime

if hasattr(sys, '_mercurial'):
_, branch, revision = sys._mercurial
elif hasattr(sys, 'subversion'):
# sys.subversion was added in Python 2.5
Expand Down
12 changes: 6 additions & 6 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ RANLIB= @RANLIB@
READELF= @READELF@
SOABI= @SOABI@
LDVERSION= @LDVERSION@
HGVERSION= @HGVERSION@
HGTAG= @HGTAG@
HGBRANCH= @HGBRANCH@
PGO_PROF_GEN_FLAG=@PGO_PROF_GEN_FLAG@
PGO_PROF_USE_FLAG=@PGO_PROF_USE_FLAG@
LLVM_PROF_MERGER=@LLVM_PROF_MERGER@
Expand Down Expand Up @@ -741,9 +741,9 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
$(MODOBJS) \
$(srcdir)/Modules/getbuildinfo.c
$(CC) -c $(PY_CORE_CFLAGS) \
-DHGVERSION="\"`LC_ALL=C $(HGVERSION)`\"" \
-DHGTAG="\"`LC_ALL=C $(HGTAG)`\"" \
-DHGBRANCH="\"`LC_ALL=C $(HGBRANCH)`\"" \
-o $@ $(srcdir)/Modules/getbuildinfo.c

Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
Expand Down
4 changes: 4 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,10 @@ Documentation
Build
-----

- bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k.

- Issue #27659: Prohibit implicit C function declarations: use
Expand Down
46 changes: 23 additions & 23 deletions Modules/getbuildinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,47 @@
#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 + sizeof(HGVERSION) +
((sizeof(HGTAG) > sizeof(HGBRANCH)) ?
sizeof(HGTAG) : sizeof(HGBRANCH))];
const char *revision = _Py_hgversion();
const char *sep = *revision ? ":" : "";
const char *hgid = _Py_hgidentifier();
if (!(*hgid))
hgid = "default";
PyOS_snprintf(buildinfo, sizeof(buildinfo),
"%s%s%s, %.20s, %.9s", hgid, sep, revision,
DATE, TIME);
return buildinfo;
}

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;
}
6 changes: 3 additions & 3 deletions Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1960,9 +1960,9 @@ _PySys_Init(void)
PyUnicode_FromString(Py_GetVersion()));
SET_SYS_FROM_STRING("hexversion",
PyLong_FromLong(PY_VERSION_HEX));
SET_SYS_FROM_STRING("_mercurial",
Py_BuildValue("(szz)", "CPython", _Py_hgidentifier(),
_Py_hgversion()));
SET_SYS_FROM_STRING("dont_write_bytecode",
PyBool_FromLong(Py_DontWriteBytecodeFlag));
SET_SYS_FROM_STRING("api_version",
Expand Down
48 changes: 24 additions & 24 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,10 @@ build_os
build_vendor
build_cpu
build
HAS_HG
HGBRANCH
HGTAG
HGVERSION
BASECPPFLAGS
target_alias
host_alias
Expand Down Expand Up @@ -2698,17 +2698,17 @@ fi



if test -e $srcdir/.hg/dirstate
then
# Extract the first word of "hg", so it can be a program name with args.
set dummy hg; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_HAS_HG+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$HAS_HG"; then
ac_cv_prog_HAS_HG="$HAS_HG" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
Expand All @@ -2717,39 +2717,39 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_HAS_HG="found"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS

test -z "$ac_cv_prog_HAS_HG" && ac_cv_prog_HAS_HG="not-found"
fi
fi
HAS_HG=$ac_cv_prog_HAS_HG
if test -n "$HAS_HG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_HG" >&5
$as_echo "$HAS_HG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


else
HAS_HG=no-repository
fi
if test $HAS_HG = found
then
HGVERSION="hg id -i \$(srcdir)"
HGTAG="hg id -t \$(srcdir)"
HGBRANCH="hg id -b \$(srcdir)"
else
HGVERSION=""
HGTAG=""
HGBRANCH=""
fi


Expand Down
Toggle all file notes Toggle all file annotations