1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 04:29:09 +00:00

(svn r21857) -Add: Revision detection for hgsubversion repositories.

This commit is contained in:
michi_cc
2011-01-19 17:10:57 +00:00
parent 22922414eb
commit 10a7678beb
2 changed files with 20 additions and 4 deletions

View File

@@ -117,7 +117,11 @@ elif [ -d "$ROOT_DIR/.hg" ]; then
BRANCH=""
REV="$TAG"
fi
REV_NR=`LC_ALL=C hg log -f -k "(svn r" -l 1 --template "{desc}\n" | head -n 1 | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
REV_NR=`LC_ALL=C hg log -f -k "(svn r" -l 1 --template "{desc|firstline}\n" | grep "^(svn r[0-9]*)" | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
if [ -z "$REV_NR" ]; then
# No rev? Maybe it is a custom hgsubversion clone
REV_NR=`LC_ALL=C hg parent --template="{svnrev}"`
fi
elif [ -f "$ROOT_DIR/.ottdrev" ]; then
# We are an exported source bundle
cat $ROOT_DIR/.ottdrev