svn commit: r261430 - stable/10/sys/conf
Rui Paulo
rpaulo at FreeBSD.org
Mon Feb 3 08:04:10 UTC 2014
Author: rpaulo
Date: Mon Feb 3 08:04:09 2014
New Revision: 261430
URL: http://svnweb.freebsd.org/changeset/base/261430
Log:
MFC r256499:
Add support for Mercurial repositories.
Modified:
stable/10/sys/conf/newvers.sh
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/conf/newvers.sh
==============================================================================
--- stable/10/sys/conf/newvers.sh Mon Feb 3 08:00:45 2014 (r261429)
+++ stable/10/sys/conf/newvers.sh Mon Feb 3 08:04:09 2014 (r261430)
@@ -130,6 +130,15 @@ if [ -d "${SYSDIR}/../.git" ] ; then
done
fi
+if [ -d "${SYSDIR}/../.hg" ] ; then
+ for dir in /usr/bin /usr/local/bin; do
+ if [ -x "${dir}/hg" ] ; then
+ hg_cmd="${dir}/hg -R ${SYSDIR}/../.hg"
+ break
+ fi
+ done
+fi
+
if [ -n "$svnversion" ] ; then
svn=`cd ${SYSDIR} && $svnversion 2>/dev/null`
case "$svn" in
@@ -184,12 +193,23 @@ if [ -n "$p4_cmd" ] ; then
*) unset p4version ;;
esac
fi
-
+
+if [ -n "$hg_cmd" ] ; then
+ hg=`$hg_cmd id 2>/dev/null`
+ svn=`$hg_cmd svn info 2>/dev/null | \
+ awk -F': ' '/Revision/ { print $2 }'`
+ if [ -n "$svn" ] ; then
+ svn=" r${svn}"
+ fi
+ if [ -n "$hg" ] ; then
+ hg=" ${hg}"
+ fi
+fi
cat << EOF > vers.c
$COPYRIGHT
-#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${p4version}: ${t}"
-#define VERSTR "${VERSION} #${v}${svn}${git}${p4version}: ${t}\\n ${u}@${h}:${d}\\n"
+#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}"
+#define VERSTR "${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}\\n ${u}@${h}:${d}\\n"
#define RELSTR "${RELEASE}"
char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;
More information about the svn-src-stable
mailing list