[configure] Use hg to compute the version string
authorYann E. MORIN
Wed Jun 17 10:46:28 2009 +0200 (2009-06-17)
changeset 14097264ce426be4
parent 1406 515580cad631
child 1411 8dbd9e0dc1d9
[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).
.version
configure
     1.1 --- a/.version	Sun Jun 14 21:44:33 2009 +0200
     1.2 +++ b/.version	Wed Jun 17 10:46:28 2009 +0200
     1.3 @@ -1,1 +1,1 @@
     1.4 -svn
     1.5 +hg
     2.1 --- a/configure	Sun Jun 14 21:44:33 2009 +0200
     2.2 +++ b/configure	Wed Jun 17 10:46:28 2009 +0200
     2.3 @@ -364,23 +364,15 @@
     2.4  # If this version is a svn snapshot, try to get the revision number
     2.5  # If we can't get the revision number, use date
     2.6  case "${VERSION}" in
     2.7 -    *+svn|svn)
     2.8 -        has_or_abort prog=svnversion
     2.9 +    *+hg|hg)
    2.10 +        has_or_abort prog=hg
    2.11          printf "Computing version string... "
    2.12 -        REVISION="$( LC_ALL=C svnversion )"
    2.13 +        REVISION="$( hg id -n 2>/dev/null )"
    2.14          case "${REVISION}" in
    2.15 -            exported)
    2.16 +            "")
    2.17                  VERSION="${VERSION}_unknown@$( date +%Y%m%d.%H%M%S )";;
    2.18              *)
    2.19 -                URL="$( LC_ALL=C svn info 2>/dev/null   \
    2.20 -                                 |egrep 'URL: '         \
    2.21 -                                 |cut -d ' ' -f 2-      \
    2.22 -                      )"
    2.23 -                ROOT="$( LC_ALL=C svn info 2>/dev/null      \
    2.24 -                         |"${grep}" '^Repository Root: '    \
    2.25 -                         |cut -d ' ' -f 3-                  \
    2.26 -                       )"
    2.27 -                VERSION="${VERSION}${URL#${ROOT}}@${REVISION}"
    2.28 +                VERSION="${VERSION}:$( hg id -b )@${REVISION%%+}:$( hg id -i )"
    2.29                  ;;
    2.30          esac
    2.31          # Arrange to have no / in the directory name, no need to create an