Whamcloud - gitweb
- landing of b_hd_cleanup_merge to HEAD.
[fs/lustre-release.git] / lustre / scripts / merge1.sh
index ac074d7..5eb7a4b 100755 (executable)
@@ -27,12 +27,12 @@ module=lustre
 
 case $parent in
   HEAD) : ;;
-  b_*|b1*) : ;;
+  b_*|b[1-4]*) : ;;
   *) parent="b_$parent" ;;
 esac
 case $child in
   HEAD) : ;;
-  b_*|b1*) : ;;
+  b_*|b[1-4]*) : ;;
   *) child="b_$child"
 esac
 
@@ -41,6 +41,18 @@ if [ "$child" != "HEAD" -a "`cat CVS/Tag 2> /dev/null`" != "T$child" ]; then
        exit 1
 fi
 
+TEST_FILE=${TEST_FILE:-ChangeLog} # does this need to be smarter?
+check_tag() {
+       [ -z "$1" ] && echo "check_tag() missing arg" && exit3
+       [ "$1" = "HEAD" ] && return
+       $CVS log $TEST_FILE 2> /dev/null | grep -q "    $1: " && return
+       echo "$0: tag $1 not found in $TEST_FILE"
+       exit 2
+}
+
+check_tag $parent
+check_tag ${CHILD}_BASE
+
 cat << EOF > .mergeinfo
 parent=$parent
 PARENT=$PARENT
@@ -49,6 +61,8 @@ CHILD=$CHILD
 date=$date
 module=$module
 CONFLICTS=$CONFLICTS
+OPERATION=Update
+OPERWHERE=from
 EOF
 
 echo PARENT: $PARENT parent: $parent CHILD: $CHILD child: $child date: $date
@@ -66,7 +80,7 @@ $CVS update -j ${CHILD}_BASE -j ${PARENT}_${CHILD}_UPDATE_PARENT_$date -dP
 echo "done"
 
 echo -n "Recording conflicts in $CONFLICTS ..."
-if $CVS update | grep '^C' > $CONFLICTS; then
+if $CVS update | awk '/^C/ { print $2 }' > $CONFLICTS; then
     echo "Conflicts found, fix before committing."
     cat $CONFLICTS
 else 
@@ -75,4 +89,4 @@ else
 fi
 echo "done"
 
-echo "Test, commit and then run merge2.sh (no arguments)"
+echo "Build, test, commit and then run merge2.sh (no arguments)"