diff options
author | des <des@FreeBSD.org> | 2004-09-24 15:24:12 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2004-09-24 15:24:12 +0000 |
commit | d8aa7d51b28b8ba7cdeba944afcea03edbf5550b (patch) | |
tree | 1dd0477e5f3312da4d8da2ca6dc8980cc647b32e /tools | |
parent | f0da78ba2231f5a639ff148003779aa80d221d1d (diff) | |
download | FreeBSD-src-d8aa7d51b28b8ba7cdeba944afcea03edbf5550b.zip FreeBSD-src-d8aa7d51b28b8ba7cdeba944afcea03edbf5550b.tar.gz |
A simple shell script to help MFC an entire directory to a branch where it
does not already exist.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tools/mfc/Makefile | 10 | ||||
-rw-r--r-- | tools/tools/mfc/mfc.sh | 38 |
2 files changed, 48 insertions, 0 deletions
diff --git a/tools/tools/mfc/Makefile b/tools/tools/mfc/Makefile new file mode 100644 index 0000000..a46dbaa --- /dev/null +++ b/tools/tools/mfc/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +BINDIR?= ${HOME}/bin +BINOWN?= `id -u` +BINGRP?= `id -g` + +SCRIPTS= mfc.sh +MAN= # none + +.include <bsd.prog.mk> diff --git a/tools/tools/mfc/mfc.sh b/tools/tools/mfc/mfc.sh new file mode 100644 index 0000000..cf7d663 --- /dev/null +++ b/tools/tools/mfc/mfc.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# +# Merge an entire directory from HEAD to a given branch +# +# $FreeBSD$ +# + +if [ $# -eq 1 -a -f CVS/Tag ] ; then + set -- "${1}" "$(sed -e 's/^T//' <CVS/Tag)" + echo "Assuming branch is $2" +fi + +if [ $# -ne 2 ] ; then + echo "usage: mfc <dir> <branch>" 1>&2 + exit 1 +fi + +dir="${1}" +branch="${2}" + +set -e + +# Get sources from HEAD +/usr/bin/cvs -f -Q up -kk -Pd -A "${dir}" + +# Fake a cvs add... +find "${dir}" -type d -name CVS | +while read d ; do + echo "${d%/CVS}" + + # Fix up Entries so the files look newly added + sed -E -i'' -e \ + "s|^/([^/]+)/.*|/\1/0/Merged \1 from HEAD//T${branch}|" \ + "${d}/Entries" + + # Set directory tag + echo "T${branch}" >"$d/Tag" +done |