]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - tools/tools/mfc/mfc.sh
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / tools / tools / mfc / mfc.sh
1 #!/bin/sh
2 #
3 # Merge an entire directory from HEAD to a given branch
4 #
5 # $FreeBSD$
6 #
7
8 if [ $# -eq 1 -a -f CVS/Tag ] ; then
9         set -- "${1}" "$(sed -e 's/^T//' <CVS/Tag)"
10         echo "Assuming branch is $2"
11 fi
12
13 if [ $# -ne 2 ] ; then
14         echo "usage: mfc <dir> <branch>" 1>&2
15         exit 1
16 fi
17
18 dir="${1}"
19 branch="${2}"
20
21 set -e
22
23 # Get sources from HEAD
24 /usr/bin/cvs -f -Q up -kk -Pd -A "${dir}"
25
26 # Fake a cvs add...
27 find "${dir}" -type d -name CVS |
28 while read d ; do
29         echo "${d%/CVS}"
30
31         # Fix up Entries so the files look newly added
32         sed -E -i'' -e \
33             "s|^/([^/]+)/.*|/\1/0/Merged \1 from HEAD//T${branch}|" \
34             "${d}/Entries"
35
36         # Set directory tag
37         echo "T${branch}" >"$d/Tag"
38 done