From: nic Date: Sat, 14 Feb 2004 07:24:05 +0000 (+0000) Subject: update b_size from HEAD (20040213_2304) X-Git-Tag: v1_7_110~2^11~18 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b94e92cd6942d82906cf1eb2e99084a55cd9dab2;p=fs%2Flustre-release.git update b_size from HEAD (20040213_2304) --- diff --git a/lustre/scripts/merge1.sh b/lustre/scripts/merge1.sh index 362ddd4..d7e0069 100755 --- a/lustre/scripts/merge1.sh +++ b/lustre/scripts/merge1.sh @@ -1,5 +1,6 @@ #!/bin/sh -e +CONFLICTS=cvs-merge-conflicts CVS=cvs if [ -f .mergeinfo ] ; then @@ -7,8 +8,8 @@ if [ -f .mergeinfo ] ; then exit fi -if [ -f merge-conflicts ] ; then - echo "cvs-merge-conflicts exists - clean up first" +if [ -f $CONFLICTS ] ; then + echo "$CONFLICTS exists - clean up first" exit fi @@ -18,17 +19,26 @@ if [ $# != 2 ]; then fi parent=$1 -PARENT=`echo $parent | tr '[a-z]' '[A-Z]'` +PARENT=`echo $parent | sed -e "s/^b_//" | tr "[a-z]" "[A-Z]"` child=$2 -CHILD=`echo $child | tr '[a-z]' '[A-Z]'` +CHILD=`echo $child | sed -e "s/^b_//" | 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" +case $parent in + HEAD) : ;; + b_*|b1*) : ;; + *) parent="b_$parent" ;; +esac +case $child in + HEAD) : ;; + b_*|b1*) : ;; + *) child="b_$child" +esac + +if [ "$child" != "HEAD" -a "`cat CVS/Tag`" != "T$child" ]; then + echo "This script must be run within the $child branch" + exit 1 fi cat << EOF > .mergeinfo @@ -38,24 +48,26 @@ child=$child CHILD=$CHILD date=$date module=$module +CONFLICTS=$CONFLICTS EOF -echo PARENT $PARENT parent $parent CHILD $CHILD child $child date $date +echo PARENT: $PARENT parent: $parent CHILD: $CHILD child: $child date: $date -echo -n "tagging $parent as ${PARENT}_${CHILD}_UPDATE_PARENT_$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 ...." +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 -n "Recording conflicts in $CONFLICTS ..." +if $CVS update | grep '^C' > $CONFLICTS; then echo "Conflicts found, fix before committing." - cat cvs-merge-conflicts + cat $CONFLICTS else echo "No conflicts found" + rm -f $CONFLICTS fi echo "Test, commit and then run merge2.sh (no arguments)" diff --git a/lustre/scripts/merge2.sh b/lustre/scripts/merge2.sh index e6ba077..43586f0 100755 --- a/lustre/scripts/merge2.sh +++ b/lustre/scripts/merge2.sh @@ -7,6 +7,14 @@ fi . .mergeinfo +if [ -f $CONFLICTS ] ; then + echo "$CONFLICTS exists - clean up first" + cat $CONFLICTS + exit +fi + +cvs update $dir 2>&1 | grep "^M" && echo "uncommitted changes" && exit 1 + echo -n "Tagging ${PARENT}_${CHILD}_UPDATE_PARENT_$date as ${CHILD}_BASE_$date ..." cvs rtag -r ${PARENT}_${CHILD}_UPDATE_PARENT_$date ${CHILD}_BASE_$date $module echo "done"