tests/test-filebranch
author Martin Geisler <mg@lazybytes.net>
Thu, 02 Sep 2010 23:22:51 +0200
changeset 12156 4c94b6d0fb1c
parent 6329 3f754be7abbb
permissions -rwxr-xr-x
tests: remove unneeded -d flags Many tests fixed the commit date of their changesets at '1000000 0' or similar. However testing with "Mon Jan 12 13:46:40 1970 +0000" is not better than testing with "Thu Jan 01 00:00:00 1970 +0000", which is the default run-tests.py installs. Removing the unnecessary flag removes some clutter and will hopefully make it clearer what the tests are really trying to test. Some tests did not even change their output when the dates were changed, in which case the -d flag was truly irrelevant. Dates used in sequence (such as '0 0', '1 0', etc...) were left alone since they may make the test easier to understand.

#!/bin/sh

# This test makes sure that we don't mark a file as merged with its ancestor
# when we do a merge.

cat <<EOF > merge
import sys, os
print "merging for", os.path.basename(sys.argv[1])
EOF
HGMERGE="python ../merge"; export HGMERGE

echo creating base
hg init a
cd a
echo 1 > foo
echo 1 > bar
echo 1 > baz
echo 1 > quux
hg add foo bar baz quux
hg commit -m "base"

cd ..
hg clone a b

echo creating branch a
cd a
echo 2a > foo
echo 2a > bar
hg commit -m "branch a"

echo creating branch b

cd ..
cd b
echo 2b > foo
echo 2b > baz
hg commit -m "branch b"

echo "we shouldn't have anything but n state here"
hg debugstate --nodates | grep -v "^n"

echo merging
hg pull ../a
hg merge -v

echo 2m > foo
echo 2b > baz
echo new > quux

echo "we shouldn't have anything but foo in merge state here"
hg debugstate --nodates | grep "^m"

hg ci -m "merge"

echo "main: we should have a merge here"
hg debugindex .hg/store/00changelog.i

echo "log should show foo and quux changed"
hg log -v -r tip

echo "foo: we should have a merge here"
hg debugindex .hg/store/data/foo.i

echo "bar: we shouldn't have a merge here"
hg debugindex .hg/store/data/bar.i

echo "baz: we shouldn't have a merge here"
hg debugindex .hg/store/data/baz.i

echo "quux: we shouldn't have a merge here"
hg debugindex .hg/store/data/quux.i

echo "manifest entries should match tips of all files"
hg manifest --debug

echo "everything should be clean now"
hg status

hg verify