Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jan 2019 14:42:37 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342760 - head/sys/conf
Message-ID:  <201901041442.x04EgbJr053441@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Fri Jan  4 14:42:36 2019
New Revision: 342760
URL: https://svnweb.freebsd.org/changeset/base/342760

Log:
  newvers: avoid clearing svn revision information with nested VCS dirs
  
  Consider the case where FreeBSD is checked out via Subversion with a
  (perhaps unrelated) .git or .hg directory at a higher level - for
  example,
  
      .../.git
      .../src/freebsd
  
  Previously newvers obtained the SVN revision information via svnversion,
  and then tried to obtain the SVN revision corresponding to the git or hg
  commit, overwriting the existing information.
  
  As a short term fix use a different variable for hg-svn or git-svn
  information, setting $svn from hg or git info only if not empty.
  
  Reported by:	Matthias Apitz
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==============================================================================
--- head/sys/conf/newvers.sh	Fri Jan  4 04:26:39 2019	(r342759)
+++ head/sys/conf/newvers.sh	Fri Jan  4 14:42:36 2019	(r342760)
@@ -244,21 +244,21 @@ fi
 
 if [ -n "$git_cmd" ] ; then
 	git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null`
-	svn=`$git_cmd svn find-rev $git 2>/dev/null`
-	if [ -n "$svn" ] ; then
-		svn=" r${svn}"
+	gitsvn=`$git_cmd svn find-rev $git 2>/dev/null`
+	if [ -n "$gitsvn" ] ; then
+		svn=" r${gitsvn}"
 		git="=${git}"
 	else
-		svn=`$git_cmd log --grep '^git-svn-id:' | \
+		gitsvn=`$git_cmd log --grep '^git-svn-id:' | \
 		    grep '^    git-svn-id:' | head -1 | \
 		    sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'`
-		if [ -z "$svn" ] ; then
-			svn=`$git_cmd log --format='format:%N' | \
+		if [ -z "$gitsvn" ] ; then
+			gitsvn=`$git_cmd log --format='format:%N' | \
 			     grep '^svn ' | head -1 | \
 			     sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'`
 		fi
-		if [ -n "$svn" ] ; then
-			svn=" r${svn}"
+		if [ -n "$gitsvn" ] ; then
+			svn=" r${gitsvn}"
 			git="+${git}"
 		else
 			git=" ${git}"
@@ -295,10 +295,10 @@ fi
 
 if [ -n "$hg_cmd" ] ; then
 	hg=`$hg_cmd id 2>/dev/null`
-	svn=`$hg_cmd svn info 2>/dev/null | \
+	hgsvn=`$hg_cmd svn info 2>/dev/null | \
 		awk -F': ' '/Revision/ { print $2 }'`
-	if [ -n "$svn" ] ; then
-		svn=" r${svn}"
+	if [ -n "$hgsvn" ] ; then
+		svn=" r${hgsvn}"
 	fi
 	if [ -n "$hg" ] ; then
 		hg=" ${hg}"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901041442.x04EgbJr053441>