X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/ed04ed77c63500d7c6caab027e88b0de8281e9e7..9fe2c9cb24e4e135249b8cdd0f7c571b87622782:/scripts/getver.sh diff --git a/scripts/getver.sh b/scripts/getver.sh index 515579201..19c8c05cd 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -23,5 +23,12 @@ try_git() { [ -n "$REV" ] } -try_version || try_svn || try_git || REV="unknown" +try_hg() { + [ -d .hg ] || return 1 + REV="$(hg log -r-1 --template '{desc}' | awk '{print $2}' | sed 's/\].*//')" + REV="${REV:+$REV}" + [ -n "$REV" ] +} + +try_version || try_svn || try_git || try_hg || REV="unknown" echo "$REV"