Date: Tue, 3 Jan 2017 18:33:19 +0000 (UTC) From: Mathieu Arnold <mat@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r430495 - head/Tools/scripts Message-ID: <201701031833.v03IXJGC032762@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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: <branch> <revnumber> [<revnumber>...]" +: ${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>] <revnumber> [<revnumber>...]" 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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701031833.v03IXJGC032762>