init_hgrepo.sh (473B)
1 #!/bin/bash 2 # Set up an hg repo for testing 3 dest=$1 4 if [ -z "$dest" ]; then 5 echo You must specify a destination directory 1>&2 6 exit 1 7 fi 8 9 rm -rf $dest 10 hg init $dest 11 cd $dest 12 13 echo "Hello world $RANDOM" > hello.txt 14 hg add hello.txt 15 hg commit -m "Adding hello" 16 17 hg branch branch2 > /dev/null 18 echo "So long, farewell" >> hello.txt 19 hg commit -m "Changing hello on branch" 20 21 hg checkout default 22 echo "Is this thing on?" >> hello.txt 23 hg commit -m "Last change on default"