summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN <devnull@localhost>2009-06-17 08:46:28 (GMT)
committerYann E. MORIN <devnull@localhost>2009-06-17 08:46:28 (GMT)
commit221701baf79454469f11789c9046fac5ca1f90c2 (patch)
tree2913689495380f4324868e5ef30682bdf1c457ac
parenta393a72f5f7b0f0f48f11782d70b255c6ca5f740 (diff)
[configure] Use hg to compute the version string
Now that we have migrated to hg from svn, it does not make sense to keep using svn tools to compute the version string, so switch to using mercurial tools (that are much more flexible, BTW).
-rw-r--r--.version2
-rwxr-xr-xconfigure18
2 files changed, 6 insertions, 14 deletions
diff --git a/.version b/.version
index c064af4..cbb0de2 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-svn
+hg
diff --git a/configure b/configure
index 518a3db..2cc9ab7 100755
--- a/configure
+++ b/configure
@@ -364,23 +364,15 @@ has_or_abort lib="${ncurses_libs}" \
# If this version is a svn snapshot, try to get the revision number
# If we can't get the revision number, use date
case "${VERSION}" in
- *+svn|svn)
- has_or_abort prog=svnversion
+ *+hg|hg)
+ has_or_abort prog=hg
printf "Computing version string... "
- REVISION="$( LC_ALL=C svnversion )"
+ REVISION="$( hg id -n 2>/dev/null )"
case "${REVISION}" in
- exported)
+ "")
VERSION="${VERSION}_unknown@$( date +%Y%m%d.%H%M%S )";;
*)
- URL="$( LC_ALL=C svn info 2>/dev/null \
- |egrep 'URL: ' \
- |cut -d ' ' -f 2- \
- )"
- ROOT="$( LC_ALL=C svn info 2>/dev/null \
- |"${grep}" '^Repository Root: ' \
- |cut -d ' ' -f 3- \
- )"
- VERSION="${VERSION}${URL#${ROOT}}@${REVISION}"
+ VERSION="${VERSION}:$( hg id -b )@${REVISION%%+}:$( hg id -i )"
;;
esac
# Arrange to have no / in the directory name, no need to create an