tests/test-convert-datesort
author Greg Ward <greg-hg@gerg.ca>
Sun, 31 May 2009 15:20:31 -0400
changeset 8674 0941ee76489e
parent 8523 5b7da468531b
child 8690 c5b4f662109f
permissions -rwxr-xr-x
run-tests: redefine --with-hg so it takes the 'hg' script to run. - in parseargs(), check that --with-hg value is valid - add handy --local option for "--with-hg=../hg" - ensure that we always set PATH and PYTHONPATH (not just when doing a temporary install) - override any existing PYTHONPATH, so test success does not depend on whatever happens to be in the caller's environment - give tests a little more control by exporting $PYTHON to the environment; needed by test-convert and test-mergetool when they run hg with a stripped-down $PATH Also, add a big comment explaining all the corner cases to test for the next person who tries to modify this script.

#!/bin/sh

cat >> $HGRCPATH <<EOF
[extensions]
convert=
graphlog=
EOF

hg init t
cd t
echo a >> a
hg ci -Am a0 -d '1 0'
hg branch brancha
echo a >> a
hg ci -m a1 -d '2 0'
echo a >> a
hg ci -m a2 -d '3 0'
echo a >> a
hg ci -m a3 -d '4 0'
hg up -C 0
hg branch branchb
echo b >> b
hg ci -Am b0 -d '5 0'
hg up -C brancha
echo a >> a
hg ci -m a4 -d '6 0'
echo a >> a
hg ci -m a5 -d '7 0'
echo a >> a
hg ci -m a6 -d '8 0'
hg up -C branchb
echo b >> b
hg ci -m b1 -d '9 0'
cd ..

echo % convert with datesort
hg convert --datesort t t2
echo % graph converted repo
hg -R t2 glog --template '{rev} "{desc}"\n'