summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-28 12:51:01 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-28 12:51:01 +0000
commitbe42404637c60969a547d7ecd98ea24882688b14 (patch)
treee18bddc0cfa8ceb252e0b0801d22bafec984e725 /scripts
parentdc9b2994c55ed3ddd034efa5f9e793d980a16be7 (diff)
add hg support to getver.sh (patch from #5763)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17432 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/getver.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/getver.sh b/scripts/getver.sh
index 5155792016..19c8c05cde 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"