From owner-svn-ports-all@freebsd.org Tue Jan 3 18:33:20 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A45C8C9DCAA; Tue, 3 Jan 2017 18:33:20 +0000 (UTC) (envelope-from mat@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 mx1.freebsd.org (Postfix) with ESMTPS id 556EC187D; Tue, 3 Jan 2017 18:33:20 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v03IXJ4N032763; Tue, 3 Jan 2017 18:33:19 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v03IXJGC032762; Tue, 3 Jan 2017 18:33:19 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201701031833.v03IXJGC032762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Tue, 3 Jan 2017 18:33:19 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r430495 - head/Tools/scripts X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2017 18:33:20 -0000 Author: mat Date: Tue Jan 3 18:33:19 2017 New Revision: 430495 URL: https://svnweb.freebsd.org/changeset/ports/430495 Log: Make sure the merge is done on the latest branch. Also, make the branch argument optional. Discussed with: swills Sponsored by: Absolight Modified: head/Tools/scripts/mfh Modified: head/Tools/scripts/mfh ============================================================================== --- head/Tools/scripts/mfh Tue Jan 3 18:28:10 2017 (r430494) +++ head/Tools/scripts/mfh Tue Jan 3 18:33:19 2017 (r430495) @@ -55,9 +55,31 @@ ask() { return 1 } -[ $# -lt 2 ] && err "$(basename $0) requires at least 2 arguments: [...]" +: ${svnserver:="svn+ssh://repo.FreeBSD.org"} + +if [ -n "$(type svn 2>/dev/null)" ]; then + svn=svn +elif [ -n "$(type svnlite 2>/dev/null)" ]; then + svn=svnlite +else + err "Neither svn(1) nor svnlite(1) found. Please install devel/subversion." +fi + +latest_branch=$("${svn}" ls ${svnserver}/ports/branches/|sed -ne '/^2.*Q./s|/$||p'|tail -1) + +[ $# -lt 1 ] && err "$(basename $0) requires at least 1 arguments: [] [...]" branch=$1 -shift + +# I sure hope by 2030 we'll be doing something else. Yes, famous last words. +if expr ${branch} : '20[12][0-9]Q[1-4]' > /dev/null; then + shift + if [ ${latest_branch} != ${branch} ]; then + ask "/!\\ The latest branch is ${latest_branch}, do you really want to commit to ${branch}?" || exit 1 + fi +else + branch=${latest_branch} +fi + revs="" for rev in $@ do @@ -67,15 +89,6 @@ do esac done -: ${svnserver:="svn+ssh://repo.FreeBSD.org"} - -if [ -n "$(type svn 2>/dev/null)" ]; then - svn=svn -elif [ -n "$(type svnlite 2>/dev/null)" ]; then - svn=svnlite -else - err "Neither svn(1) nor svnlite(1) found. Please install devel/subversion." -fi trap "rc=\$? ; rm -rf \"\${dir}\" ; exit \$rc" EXIT dir=$(mktemp -d /tmp/merge.XXXXXX)