X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fscripts%2Fmerge1.sh;fp=lustre%2Fscripts%2Fmerge1.sh;h=362ddd46bce7f8df783bda7082c94349d7e1b096;hb=0343ecb7de2dae4cf8016416bf1af5d34e9a746d;hp=0000000000000000000000000000000000000000;hpb=875c781f43408190831c70ee61617a7efa549ad8;p=fs%2Flustre-release.git diff --git a/lustre/scripts/merge1.sh b/lustre/scripts/merge1.sh new file mode 100755 index 0000000..362ddd4 --- /dev/null +++ b/lustre/scripts/merge1.sh @@ -0,0 +1,61 @@ +#!/bin/sh -e + +CVS=cvs + +if [ -f .mergeinfo ] ; then + echo ".mergeinfo exists - clean up first" + exit +fi + +if [ -f merge-conflicts ] ; then + echo "cvs-merge-conflicts exists - clean up first" + exit +fi + +if [ $# != 2 ]; then + echo "This is phase 1 of merging branches. Usage: $0 parent child" + exit +fi + +parent=$1 +PARENT=`echo $parent | tr '[a-z]' '[A-Z]'` +child=$2 +CHILD=`echo $child | tr '[a-z]' '[A-Z]'` +date=`date +%Y%m%d_%H%M` +module=lustre + +if [ $parent != "HEAD" ]; then + parent="b_$parent" +fi +if [ $child != "HEAD" ]; then + child="b_$child" +fi + +cat << EOF > .mergeinfo +parent=$parent +PARENT=$PARENT +child=$child +CHILD=$CHILD +date=$date +module=$module +EOF + +echo PARENT $PARENT parent $parent CHILD $CHILD child $child date $date + +echo -n "tagging $parent as ${PARENT}_${CHILD}_UPDATE_PARENT_$date ...." +$CVS rtag -r $parent ${PARENT}_${CHILD}_UPDATE_PARENT_$date $module +echo "done" +echo -n "tagging $child as ${PARENT}_${CHILD}_UPDATE_CHILD_$date ...." +$CVS rtag -r $child ${PARENT}_${CHILD}_UPDATE_CHILD_$date $module +echo "done" +echo "Updating: -j ${CHILD}_BASE -j ${PARENT}_${CHILD}_UPDATE_PARENT_$date ...." +$CVS update -j ${CHILD}_BASE -j ${PARENT}_${CHILD}_UPDATE_PARENT_$date -dP +echo "done" +echo -n "Recording conflicts in cvs-merge-conflicts ..." +if $CVS update | grep '^C' > cvs-merge-conflicts; then + echo "Conflicts found, fix before committing." + cat cvs-merge-conflicts +else + echo "No conflicts found" +fi +echo "Test, commit and then run merge2.sh (no arguments)"