6 if [ $# -lt 2 -o $# -gt 3 ]; then
7 echo "This creates a new branch in CVS. Usage: $progname parent child <dir>"
13 CHILD=`echo $child | sed -e "s/^b_//" | tr "[a-z]" "[A-Z]"`
15 if [ ! -d $dir ]; then
16 echo >&2 "${progname}: directory '$dir' does not exist."
19 module=$(basename $(<$dir/CVS/Repository))
21 if [ "$module" = "lustre" ]; then
22 echo >&2 "${progname}: You probably want to branch lustre or lnet."
23 echo >&2 "${progname}: Try using ${0} $parent $child lustre"
30 *) parent="b_$parent" ;;
38 #if [ "$parent" != "HEAD" -a -f $dir/CVS/Tag ]; then
39 # put in separate condition as bash evaluates all conditions unlike C
40 # if [ "`cat $dir/CVS/Tag`" != "T$parent" ]; then
41 # echo "This script must be run within the $parent branch"
46 echo parent: $parent CHILD: $CHILD child: $child date: $date
48 echo -n "tagging $parent as '${CHILD}_BASE' ...."
49 $CVS rtag -r $parent ${CHILD}_BASE $module
51 echo -n "branching $child at ${CHILD}_BASE' ...."
52 $CVS rtag -b -r ${CHILD}_BASE $child $module
53 echo -n "updating $dir to $child ...."
54 $CVS update -r $child $dir