chiark / gitweb /
New tool to get/update/switch (as appropriate) subdirectories in a tree
[bin.git] / cvs-takeover
1 #! /bin/sh
2 set -e
3
4 if [ -z "$1" ]; then
5     echo "Usage: $0 directory-to-take-over" >&2
6     exit 1
7 fi
8
9 for x in `find . -name CVS -prune -o -type d -print`; do
10     if [ -d "$1/$x/CVS" ] && [ ! -d "$x/CVS" ]; then
11         cp -a "$1/$x/CVS" "$x/"
12     else
13         echo "Not taking over $x; $1/$x/CVS missing or $x/CVS present." >&2
14     fi
15 done
16
17 exit 0