(svn r11148) -Codechange: add support for getting version numbers from Mercurial/HG instead of norev000 (when using a Mercurial/HG clone that is).
authorrubidium
Sun, 23 Sep 2007 10:26:20 +0000
changeset 8114 9160c0aa6997
parent 8113 f7a573c5d56c
child 8115 95deea94d1f5
(svn r11148) -Codechange: add support for getting version numbers from Mercurial/HG instead of norev000 (when using a Mercurial/HG clone that is).
Makefile.src.in
config.lib
--- a/Makefile.src.in	Sun Sep 23 09:37:25 2007 +0000
+++ b/Makefile.src.in	Sun Sep 23 10:26:20 2007 +0000
@@ -102,8 +102,14 @@
 else
 # Are we a git dir?
 ifeq ($(shell if test -d $(SRC_DIR)/../.git; then echo 1; fi), 1)
-# Find the revision like: rXXXXM
-REV := g$(shell if head=`git rev-parse --verify HEAD 2>/dev/null`; then echo "$$head" | cut -c1-8; fi)$(shell if git diff-index HEAD | read dummy; then echo M; fi)$(shell git branch|grep '[*]'|sed 's/\* /-/;s/^-master$$//')
+# Find the revision like: gXXXXM-branch
+REV := g$(shell if head=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null`; then echo "$$head" | cut -c1-8; fi)$(shell if git diff-index HEAD | read dummy; then echo M; fi)$(shell git branch|grep '[*]' | sed 's/\* /-/;s/^-master$$//')
+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)$(shell if hg status | grep -v '^?' | read dummy; then echo M; fi)$(shell hg branch | sed 's/^/-/;s/^-default$$//')
+endif
 endif
 endif
 endif
--- a/config.lib	Sun Sep 23 09:37:25 2007 +0000
+++ b/config.lib	Sun Sep 23 10:26:20 2007 +0000
@@ -702,6 +702,9 @@
 		elif [ -d "$ROOT_DIR/.git" ] && [ -n "`git help`" ]; then
 			revision=""
 			log 1 "checking revision... git detection"
+		elif [ -d "$ROOT_DIR/.hg" ] && [ -n "`hg help`" ]; then
+			revision=""
+			log 1 "checking revision... hg detection"
 		else
 			revision=""
 			log 1 "checking revision... no detection"