Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2013 14:43:58 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r336919 - head/Tools/scripts
Message-ID:  <201312191443.rBJEhwjT063883@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Thu Dec 19 14:43:58 2013
New Revision: 336919
URL: http://svnweb.freebsd.org/changeset/ports/336919

Log:
  Import mfh script to merge to the Q branches

Added:
  head/Tools/scripts/mfh   (contents, props changed)
Modified:
  head/Tools/scripts/README

Modified: head/Tools/scripts/README
==============================================================================
--- head/Tools/scripts/README	Thu Dec 19 14:43:27 2013	(r336918)
+++ head/Tools/scripts/README	Thu Dec 19 14:43:58 2013	(r336919)
@@ -31,6 +31,7 @@ getpr   - downloads a problem report fro
 gnomedepends - Analyse pkg/PLIST and give an advice as to which GNOME ports
                should be listes in {RUN,LIB}_DEPENDS for this port
 mark_safe.pl - utility to set subsets of ports to MAKE_JOBS_(UN)SAFE=yes
+mfh - Merge from head to a given branch
 neededlibs.sh - Extract direct library dependencies from binaries.
 plist - automate (mostly, at least) pkg-plist generation
 portsearch - A utility for searching the ports tree. It allows more detailed

Added: head/Tools/scripts/mfh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/Tools/scripts/mfh	Thu Dec 19 14:43:58 2013	(r336919)
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# mfh - Merge from head to a given branch
+# Copyright 2013 Baptiste Daroussin
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# MAINTAINER=	portmgr@FreeBSD.org
+
+set -e
+
+err() {
+	echo $@ >&2
+	exit 1
+}
+
+clean() {
+	rm -rf ${dir}
+	exit 1
+}
+
+ask() {
+	question=${1}
+
+	answer=x
+	while [ "${answer}" != "y" -a "${answer}" != "n" ] ; do
+		read -p "${question} [yn] " answer
+	done
+
+	[ "${answer}" = "y" ] && return 0
+	return 1
+}
+
+[ $# -ne 2 ] && err "Takes 2 arguments: <branch> <revnumber>"
+branch=$1
+rev=$2
+case $rev in
+''|*[!0-9]*) err "revision should be a number" ;;
+esac
+
+dir=$(mktemp -d /tmp/merge.XXX)
+cd $dir
+svn co --depth=empty svn+ssh://svn.FreeBSD.org/ports/branches/${branch}
+filelist=""
+for f in $(svn diff --summarize -c $rev svn://svn.FreeBSD.org/ports/head); do
+	case ${f} in
+	*/*) ;;
+	*)continue;;
+	esac
+	f=${f#*/ports/head/}
+	f=${f%/*}
+	filelist="$filelist\n$f"
+done
+filelist=$(echo -e $filelist | sort -u)
+echo "MFH: r$rev" > commit.txt
+svn log -r$rev svn://svn.freebsd.org/ports/head | sed '1,2d;$d' >> commit.txt
+for f in ${filelist}; do
+	svn up --parents ${branch}/${f}
+done
+svn merge -c r${rev} ^/head/ ${branch}
+svn up --quiet ${branch}
+svn diff ${branch}
+ask "Do you want to commit?" || clean
+${EDITOR:-vi} commit.txt
+svn ci -F commit.txt ${branch}
+rm -rf $dir



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