direct-io.hg

changeset 10132:2e85df9329f8

[IA64] sparse-merge: check SPARSEDIR for modifications

Check SPARSEDIR for modifications before allowing the merge.
This removes the need for the FIXME. Additionally clean up
empty diffs at the end of the run.

Signed-off-by: Aron Griffis <aron@hp.com>
author awilliam@xenbuild.aw
date Sun May 21 07:24:51 2006 -0600 (2006-05-21)
parents 03424ac6fd58
children df3d143a1139
files xen/arch/ia64/tools/sparse-merge
line diff
     1.1 --- a/xen/arch/ia64/tools/sparse-merge	Sun May 21 07:22:58 2006 -0600
     1.2 +++ b/xen/arch/ia64/tools/sparse-merge	Sun May 21 07:24:51 2006 -0600
     1.3 @@ -14,16 +14,23 @@
     1.4  : ${ARCH:=ia64}
     1.5  
     1.6  SPARSEDIR=linux-2.6-xen-sparse
     1.7 +WD=$PWD
     1.8  
     1.9  if [ ! -d $SPARSEDIR ]; then
    1.10  	echo "Can't find $SPARSEDIR directory."
    1.11  	exit
    1.12  fi
    1.13  
    1.14 -WD=$PWD
    1.15 -# We want the linux upsream tree to be at the OLDTAG to get the OLDTAG-Xen diff.
    1.16 +# Check for modified files in the sparse tree before starting
    1.17 +if hg st $SPARSEDIR | head | grep .; then
    1.18 +    echo
    1.19 +    echo "$SPARSEDIR contains modifications, please clean it up first"
    1.20 +    exit
    1.21 +fi
    1.22 +
    1.23 +# We want the linux upstream tree to be at the OLDTAG to get the OLDTAG-Xen diff.
    1.24  # Save current revision to restore when done
    1.25 -cd $LINUXPATH
    1.26 +cd $LINUXPATH || exit 1
    1.27  OLDCSET=$(hg parents | awk '/^changeset:/{print($2)}' | cut -f 1 -d :)
    1.28  for t in $OLDTAG $NEWTAG; do
    1.29      if ! hg tags | cut -f1 -d' ' | grep -Fx $t; then
    1.30 @@ -36,6 +43,7 @@ for t in $OLDTAG $NEWTAG; do
    1.31      fi
    1.32  done
    1.33  hg up -C $OLDTAG || exit 1
    1.34 +
    1.35  cd $WD
    1.36  for i in $(hg manifest | awk '{print($3)}' | grep $SPARSEDIR | grep "$ARCH"); do
    1.37  	cd $WD
    1.38 @@ -58,9 +66,6 @@ for i in $(hg manifest | awk '{print($3)
    1.39  	cd $DIRNAME
    1.40  	XENDIR=$(pwd)
    1.41  
    1.42 -	### FIXME ###
    1.43 -	hg revert $FILENAME
    1.44 -
    1.45  	ORIGPATH=$(echo $i | sed -e "s/^$SPARSEDIR/./")
    1.46  	APATH=$(echo $i | sed -e "s/^$SPARSEDIR/a/")
    1.47  	BPATH=$(echo $i | sed -e "s/^$SPARSEDIR/b/")
    1.48 @@ -85,7 +90,7 @@ for i in $(hg manifest | awk '{print($3)
    1.49  		fi
    1.50  		TONEWREJ=$(wc -l ${FILENAME}.rej | \
    1.51  		           awk '{print($1)}')
    1.52 -		hg revert $FILENAME
    1.53 +		hg st $FILENAME | grep -q . && hg revert $FILENAME
    1.54  		rm -f ${FILENAME}.rej ${FILENAME}.orig
    1.55  		diff -uN $DIFFPATH $FILENAME | \
    1.56  		    sed -e "s,^--- $DIFFPATH,--- $FILENAME," \
    1.57 @@ -134,6 +139,6 @@ for i in $(hg manifest | awk '{print($3)
    1.58  			echo "SUCCESS (Upstream applied)"
    1.59  	fi
    1.60  done
    1.61 +find $SPARSEDIR -name \*.diff -empty | xargs -r rm -f
    1.62  cd $LINUXPATH
    1.63  hg up -C $OLDCSET
    1.64 -cd $WD