view contrib/packagelib.sh @ 26460:79ef867538ea

branchmap: move branch cache code out of streamclone.py This is low-level branch map and cache manipulation code. It deserves to live next to similar code in branchmap.py. Moving it also paves the road for multiple consumers, such as a bundle2 part handler that receives branch mappings from a remote. This is largely a mechanical move, with only variable names and indentation being changed.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 03 Oct 2015 09:53:56 -0700
parents 56c64c91b429
children 6474b64045fb
line wrap: on
line source

gethgversion() {
    make clean
    make local || make local PURE=--pure
    HG="$PWD/hg"

    $HG version > /dev/null || { echo 'abort: hg version failed!'; exit 1 ; }

    hgversion=`$HG version | sed -ne 's/.*(version \(.*\))$/\1/p'`

    if echo $hgversion | grep -- '-' > /dev/null 2>&1; then
        # nightly build case, version is like 1.3.1+250-20b91f91f9ca
        version=`echo $hgversion | cut -d- -f1`
        release=`echo $hgversion | cut -d- -f2 | sed -e 's/+.*//'`
    else
        # official tag, version is like 1.3.1
        version=`echo $hgversion | sed -e 's/+.*//'`
        release='0'
    fi
}