-#!/bin/sh -e
+#!/bin/bash -e
progname=${0##*/}
fi
if [ $# -lt 2 -o $# -gt 3 ]; then
- echo "This is phase 1 of replacing branches. Usage: $0 parent(old) child(new) [dir]"
+ echo "This is phase 1 of replacing branches. Run this in the PARENT tree. Usage: $0 parent(will be replaced) child(will become the new parent) [dir]"
exit
fi
# Apply all of the changes to your local tree:
echo -n "Updating as -j $parent -j $child ..."
-$CVS update -j $parent -j $child $dir
+$CVS update -j $parent -j $child -dP $dir
echo "done"
echo -n "Recording conflicts in $CONFLICTS ..."
-$CVS update | awk '/^C/ { print $2 }' > $CONFLICTS
+$CVS update $dir | awk '/^C/ { print $2 }' > $CONFLICTS
if [ -s $CONFLICTS ] ; then
echo "Conflicts found, fix before committing."
cat $CONFLICTS
fi
+echo "done"
+echo -n "Verifying that there are no diffs from $child ..."
$CVS diff --brief -r $child $dir >> $CONFLICTS
if [ -s $CONFLICTS ] ; then
echo "Danger! The child branch $CHILD differs from the updated branch $dir"
echo "No conflicts found"
rm -f $CONFLICTS
fi
-
echo "done"
echo "Build, test, commit and then run replace2.sh (no arguments)"