Changeset - r17110:a05cf3cd6325
[Not reviewed]
master
0 2 0
michi_cc - 14 years ago 2011-01-19 17:10:57
michi_cc@openttd.org
(svn r21857) -Add: Revision detection for hgsubversion repositories.
2 files changed with 19 insertions and 3 deletions:
0 comments (0 inline, 0 general)
findversion.sh
Show inline comments
 
@@ -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
projects/determineversion.vbs
Show inline comments
 
@@ -278,11 +278,23 @@ Function DetermineSVNVersion()
 
							End If ' line <> "default"
 
						End If ' Err.Number = 0
 

	
 
						Set oExec = WshShell.Exec("hg log -f -k " & Chr(34) & "(svn r" & Chr(34) & " -l 1 --template " & Chr(34) & "{desc}\n" & Chr(34) & " --cwd ../")
 
						Set oExec = WshShell.Exec("hg log -f -k " & Chr(34) & "(svn r" & Chr(34) & " -l 1 --template " & Chr(34) & "{desc|firstline}\n" & Chr(34) & " --cwd ../")
 
						If Err.Number = 0 Then
 
							revision = Mid(OExec.StdOut.ReadLine(), 7)
 
							line = oExec.StdOut.ReadLine()
 
							If Left(line, 6) = "(svn r" Then
 
								revision = Mid(line, 7)
 
							revision = Mid(revision, 1, InStr(revision, ")") - 1)
 
							End If 'Left(line, 6) = "(svn r"
 
						End If ' Err.Number = 0
 

	
 
						If revision = "" Then
 
							' No rev? Maybe it is a custom hgsubversion clone
 
							Err.Clear
 
							Set oExec = WshShell.Exec("hg parent --template=" & Chr(34) & "{svnrev}" & Chr(34))
 
							If Err.Number = 0 Then
 
								revision = oExec.StdOut.ReadLine()
 
							End If ' Err.Number = 0
 
						End If ' revision = ""
 
					End If ' Err.Number = 0
 
				End If ' oExec.ExitCode = 0
 
			End If ' Err.Number = 0
0 comments (0 inline, 0 general)