Changeset - r17653:8e16767f3f42
[Not reviewed]
master
0 2 0
michi_cc - 14 years ago 2011-05-07 15:13:52
michi_cc@openttd.org
(svn r22435) -Fix: Git revision detection would return too much when tags are involved.
2 files changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
findversion.sh
Show inline comments
 
@@ -96,13 +96,13 @@ elif [ -d "$ROOT_DIR/.git" ]; then
 
	BRANCH="`git symbolic-ref -q HEAD 2>/dev/null | sed 's@.*/@@;s@^master$@@'`"
 
	REV_NR=`LC_ALL=C git log --pretty=format:%s --grep="^(svn r[0-9]*)" -1 | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
 
	if [ -z "$REV_NR" ]; then
 
		# No rev? Maybe it is a custom git-svn clone
 
		REV_NR=`LC_ALL=C git log --pretty=format:%b --grep="git-svn-id:.*@[0-9]*" -1 | sed "s@.*\@\([0-9]*\).*@\1@"`
 
	fi
 
	TAG="`git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null`"
 
	TAG="`git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null | sed 's@\^0$@@'`"
 
	if [ -n "$TAG" ]; then
 
		BRANCH=""
 
		REV="$TAG"
 
	fi
 
elif [ -d "$ROOT_DIR/.hg" ]; then
 
	# We are a hg checkout
projects/determineversion.vbs
Show inline comments
 
@@ -224,12 +224,15 @@ Function DetermineSVNVersion()
 
					If Err.Number = 0 Then
 
						' Wait till the application is finished ...
 
						Do While oExec.Status = 0
 
						Loop
 
						If oExec.ExitCode = 0 Then
 
							version = oExec.StdOut.ReadLine()
 
							If Right(version, 2) = "^0" Then
 
								version = Left(version, Len(version) - 2)
 
							End If
 
							branch = ""
 
						End If ' oExec.ExitCode = 0
 
					End If ' Err.Number = 0
 
				End If ' Err.Number = 0
 
			End If ' oExec.ExitCode = 0
 
		End If ' Err.Number = 0
0 comments (0 inline, 0 general)