diff options
author | Ned Deily <nad@python.org> | 2017-03-04 05:19:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-04 05:19:55 (GMT) |
commit | 5c4b0d063aba0a68c325073f5f312a2c9f40d178 (patch) | |
tree | 9dd85d1261b732477a4ed38bd5d63de2d3c2e847 /configure.ac | |
parent | fc64c351c7757f0ebdb7da65cb74871e494a2add (diff) | |
download | cpython-5c4b0d063aba0a68c325073f5f312a2c9f40d178.zip cpython-5c4b0d063aba0a68c325073f5f312a2c9f40d178.tar.gz cpython-5c4b0d063aba0a68c325073f5f312a2c9f40d178.tar.bz2 |
bpo-27593: Get SCM build info from git instead of hg. (#446)
sys.version and the platform module python_build(),
python_branch(), and python_revision() functions now use
git information rather than hg when building from a repo.
Based on original patches by Brett Cannon and Steve Dower.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index 5610c57..6e78bb6 100644 --- a/configure.ac +++ b/configure.ac @@ -25,25 +25,25 @@ else BASECPPFLAGS="" fi -AC_SUBST(HGVERSION) -AC_SUBST(HGTAG) -AC_SUBST(HGBRANCH) +AC_SUBST(GITVERSION) +AC_SUBST(GITTAG) +AC_SUBST(GITBRANCH) -if test -e $srcdir/.hg/dirstate +if test -e $srcdir/.git/HEAD then -AC_CHECK_PROG(HAS_HG, hg, found, not-found) +AC_CHECK_PROG(HAS_GIT, git, found, not-found) else -HAS_HG=no-repository +HAS_GIT=no-repository fi -if test $HAS_HG = found +if test $HAS_GIT = found then - HGVERSION="hg id -i \$(srcdir)" - HGTAG="hg id -t \$(srcdir)" - HGBRANCH="hg id -b \$(srcdir)" + GITVERSION="git -C \$(srcdir) rev-parse HEAD" + GITTAG="git -C \$(srcdir) name-rev --tags --name-only HEAD" + GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD" else - HGVERSION="" - HGTAG="" - HGBRANCH="" + GITVERSION="" + GITTAG="" + GITBRANCH="" fi AC_CONFIG_SRCDIR([Include/object.h]) |