From owner-svn-src-head@freebsd.org Fri Jan 4 14:42:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3E90142DF07; Fri, 4 Jan 2019 14:42:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48AAF6C0B2; Fri, 4 Jan 2019 14:42:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 391522074; Fri, 4 Jan 2019 14:42:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04EgbOw053442; Fri, 4 Jan 2019 14:42:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04EgbJr053441; Fri, 4 Jan 2019 14:42:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901041442.x04EgbJr053441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 4 Jan 2019 14:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342760 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 342760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48AAF6C0B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2019 14:42:37 -0000 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}"