Changeset - r17093:5363240a7d0a
[Not reviewed]
master
0 2 0
michi_cc - 14 years ago 2011-01-18 21:27:35
michi_cc@openttd.org
(svn r21840) -Change: Support tags created by hgsubversion for the revision detection.
2 files changed with 20 insertions and 2 deletions:
0 comments (0 inline, 0 general)
findversion.sh
Show inline comments
 
@@ -103,24 +103,29 @@ elif [ -d "$ROOT_DIR/.git" ]; then
 
	if [ -n "$TAG" ]; then
 
		BRANCH=""
 
		REV=$TAG
 
	fi
 
elif [ -d "$ROOT_DIR/.hg" ]; then
 
	# We are a hg checkout
 
	if [ -n "`hg status | grep -v '^?'`" ]; then
 
		MODIFIED="2"
 
	fi
 
	HASH=`LC_ALL=C hg id -i | cut -c1-12`
 
	REV="h`echo $HASH | cut -c1-8`"
 
	BRANCH=`hg branch | sed 's@^default$@@'`
 
	TAG=`hg id -t`
 
	if [ -n "$TAG" ] && [ $TAG != "tip" ]; 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@"`
 
elif [ -f "$ROOT_DIR/.ottdrev" ]; then
 
	# We are an exported source bundle
 
	cat $ROOT_DIR/.ottdrev
 
	exit
 
else
 
	# We don't know
 
	MODIFIED="1"
 
	BRANCH=""
 
	REV=""
 
	REV_NR=""
 
fi
projects/determineversion.vbs
Show inline comments
 
@@ -228,34 +228,47 @@ Function DetermineSVNVersion()
 
						If oExec.ExitCode = 0 Then
 
							version = oExec.StdOut.ReadLine()
 
							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
 

	
 
		If version = "norev000" Then
 
			' git detection failed, reset error and try mercurial (hg)
 
			Err.Clear
 
			Set oExec = WshShell.Exec("hg parents")
 
			Set oExec = WshShell.Exec("hg id -i")
 
			If Err.Number = 0 Then
 
				' Wait till the application is finished ...
 
				Do While oExec.Status = 0
 
				Loop
 

	
 
				If oExec.ExitCode = 0 Then
 
					line = OExec.StdOut.ReadLine()
 
					hash = Mid(line, InStrRev(line, ":") + 1)
 
					hash = Left(line, 12)
 
					version = "h" & Mid(hash, 1, 8)
 

	
 
					' Check if a tag is currently checked out
 
					Err.Clear
 
					Set oExec = WshShell.Exec("hg id -t")
 
					If Err.Number = 0 Then
 
						line = oExec.StdOut.ReadLine()
 
						If Len(line) > 0 And line <> "tip" Then
 
							version = line
 
							branch = ""
 
						End If ' Len(line) > 0 And line <> "tip"
 
					End If ' Err.Number = 0
 

	
 
					Err.Clear
 
					Set oExec = WshShell.Exec("hg status ../")
 
					If Err.Number = 0 Then
 
						Do
 
							line = OExec.StdOut.ReadLine()
 
							If Len(line) > 0 And Mid(line, 1, 1) <> "?" Then
 
								modified = 2
 
								Exit Do
 
							End If ' Len(line) > 0 And Mid(line, 1, 1) <> "?"
 
						Loop While Not OExec.StdOut.atEndOfStream
 

	
 
						Set oExec = WshShell.Exec("hg branch")
 
						If Err.Number = 0 Then
0 comments (0 inline, 0 general)