Whamcloud - gitweb
Fixes and cleanups in lmv.
[fs/lustre-release.git] / lustre / scripts / land1.sh
index 16f6b20..08f559a 100755 (executable)
@@ -27,20 +27,32 @@ 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
 
-if [ "$parent" != "HEAD" -a "`cat CVS/Tag`" != "T$parent" ]; then
-        echo "This script must be run within the $parent branch"
+if [ "$parent" != "HEAD" -a "`cat CVS/Tag 2> /dev/null`" != "T$parent" ]; then
+        echo "$0: this script must be run within the $parent branch"
        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 | grep -q " $1: " && return
+       echo "$0: tag $1 not found in $TEST_FILE"
+       exit 2
+}
+
+check_tag $child
+check_tag ${CHILD}_BASE
+
 dir=$3
 
 cat << EOF > .mergeinfo
@@ -52,6 +64,8 @@ date=$date
 module=$module
 dir=$dir
 CONFLICTS=$CONFLICTS
+OPERATION=Land
+OPERWHERE=onto
 EOF
 
 echo PARENT $PARENT parent $parent CHILD $CHILD child $child date $date