Changeset - r10035:361ab00f9451
[Not reviewed]
master
0 2 0
glx - 16 years ago 2008-08-30 13:15:36
glx@openttd.org
(svn r14194) -Fix: don't use hardcoded character offsets to get hg revision. This make it similar to svn and git (ie without the ':').
2 files changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
Makefile.src.in
Show inline comments
 
@@ -123,7 +123,7 @@ else
 
# Are we a SVN dir?
 
ifeq ($(shell if test -d $(SRC_DIR)/.svn; then echo 1; fi), 1)
 
# Find if the local source if modified
 
# Find the revision like: rXXXX-branch
 
# Find the revision like: rXXXXM-branch
 
REV := $(shell LC_ALL=C svn info $(SRC_DIR) | $(AWK) '/^URL:.*branches/ { split($$2, a, "/"); for(i in a) if (a[i]=="branches") { BRANCH="-"a[i+1]; break } } /^Last Changed Rev:/ { REV="r"$$4"$(REV_MODIFIED)" } END { print REV BRANCH }')
 
REV_NR := $(shell LC_ALL=C svn info $(SRC_DIR) | $(AWK) '/^Last Changed Rev:/ { print $$4 }')
 
else
 
@@ -136,7 +136,7 @@ else
 
# Are we a hg (Mercurial) dir?
 
ifeq ($(shell if test -d $(SRC_DIR)/../.hg; then echo 1; fi), 1)
 
# Find the revision like: hXXXXM-branch
 
REV := h$(shell if head=`LC_ALL=C hg tip 2>/dev/null`; then echo "$$head" | head -n 1 | cut -c19-26; fi)$(REV_MODIFIED)$(shell hg branch | sed 's/^/-/;s/^-default$$//')
 
REV := h$(shell if head=`LC_ALL=C hg tip 2>/dev/null`; then echo "$$head" | head -n 1 | cut -d: -f3 | cut -c1-8; fi)$(REV_MODIFIED)$(shell hg branch | sed 's/^/-/;s/^-default$$//')
 
REV_NR := $(shell LC_ALL=C hg log -k "svn" -l 1 --template "{desc}\n" $(SRC_DIR) | grep -m 1 "^(svn r[0-9]*)" | sed "s/.*(svn r\([0-9]*\)).*/\1/" )
 
endif
 
endif
projects/determineversion.vbs
Show inline comments
 
@@ -199,7 +199,7 @@ Function DetermineSVNVersion()
 
			Set oExec = WshShell.Exec("git symbolic-ref HEAD")
 
			If Err.Number = 0 Then
 
				line = oExec.StdOut.ReadLine()
 
				line = Mid(line, InStrRev(line, "/")+1)
 
				line = Mid(line, InStrRev(line, "/") + 1)
 
				If line <> "master" Then
 
					version = version & "-" & line
 
				End If
 
@@ -214,7 +214,8 @@ Function DetermineSVNVersion()
 
				Loop
 
			End If
 
			If Err.Number = 0 And oExec.ExitCode = 0 Then
 
				version = "h" & Mid(OExec.StdOut.ReadLine(), 19, 8)
 
				line = OExec.StdOut.ReadLine()
 
				version = "h" & Mid(line, InStrRev(line, ":") + 1, 8)
 
				Set oExec = WshShell.Exec("hg status ../src")
 
				If Err.Number = 0 Then
 
					Do
0 comments (0 inline, 0 general)