diff options
author | mat <mat@FreeBSD.org> | 2017-01-04 02:33:19 +0800 |
---|---|---|
committer | mat <mat@FreeBSD.org> | 2017-01-04 02:33:19 +0800 |
commit | e7c77e70d1b710db3ecdd1f131a1f4b009832927 (patch) | |
tree | 904f13fab3e3b45edfe55ca1132f417db77504aa /Tools/scripts/mfh | |
parent | d09af87868309971e042f03ed5b1fc4e2ea78713 (diff) | |
download | freebsd-ports-gnome-e7c77e70d1b710db3ecdd1f131a1f4b009832927.tar.gz freebsd-ports-gnome-e7c77e70d1b710db3ecdd1f131a1f4b009832927.tar.zst freebsd-ports-gnome-e7c77e70d1b710db3ecdd1f131a1f4b009832927.zip |
Make sure the merge is done on the latest branch.
Also, make the branch argument optional.
Discussed with: swills
Sponsored by: Absolight
Diffstat (limited to 'Tools/scripts/mfh')
-rwxr-xr-x | Tools/scripts/mfh | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/Tools/scripts/mfh b/Tools/scripts/mfh index a8b4cc323beb..6d393c19f02c 100755 --- a/Tools/scripts/mfh +++ b/Tools/scripts/mfh @@ -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) |