Mercurial > hg-stable
view tests/test-ssh-clone-r @ 9143:a604c98dbf62
test-tags: clarify test output; simplify test script a bit (issue548).
- use simpler way ('hg id') to get current changeset id
- add 'echo' statements to guide the eye when reading output
- add some more output to clarify the state of .hgtags
- drop '-d' option from every commit/tag, since run-tests.py
does this (although with a different timestamp, so changeset
ids differ)
author | Greg Ward <greg-hg@gerg.ca> |
---|---|
date | Thu, 16 Jul 2009 10:39:41 -0400 |
parents | 6b1e1b9da853 |
children |
line wrap: on
line source
#!/bin/sh # This test tries to exercise the ssh functionality with a dummy script cat <<EOF > dummyssh import sys import os os.chdir(os.path.dirname(sys.argv[0])) if sys.argv[1] != "user@dummy": sys.exit(-1) if not os.path.exists("dummyssh"): sys.exit(-1) os.environ["SSH_CLIENT"] = "127.0.0.1 1 2" log = open("dummylog", "ab") log.write("Got arguments") for i, arg in enumerate(sys.argv[1:]): log.write(" %d:%s" % (i+1, arg)) log.write("\n") log.close() r = os.system(sys.argv[2]) sys.exit(bool(r)) EOF hg init remote cd remote echo "# creating 'remote'" cat >>afile <<EOF 0 EOF hg add afile hg commit -m "0.0" cat >>afile <<EOF 1 EOF hg commit -m "0.1" cat >>afile <<EOF 2 EOF hg commit -m "0.2" cat >>afile <<EOF 3 EOF hg commit -m "0.3" hg update -C 0 cat >>afile <<EOF 1 EOF hg commit -m "1.1" cat >>afile <<EOF 2 EOF hg commit -m "1.2" cat >fred <<EOF a line EOF cat >>afile <<EOF 3 EOF hg add fred hg commit -m "1.3" hg mv afile adifferentfile hg commit -m "1.3m" hg update -C 3 hg mv afile anotherfile hg commit -m "0.3m" hg debugindex .hg/store/data/afile.i hg debugindex .hg/store/data/adifferentfile.i hg debugindex .hg/store/data/anotherfile.i hg debugindex .hg/store/data/fred.i hg debugindex .hg/store/00manifest.i hg verify cd .. echo "# clone remote via stream" for i in 0 1 2 3 4 5 6 7 8; do hg clone -e "python ./dummyssh" --uncompressed -r "$i" ssh://user@dummy/remote test-"$i" 2>&1 if cd test-"$i"; then hg verify cd .. fi done cd test-8 hg pull ../test-7 hg verify cd .. cd test-1 hg pull -e "python ../dummyssh" -r 4 ssh://user@dummy/remote 2>&1 hg verify hg pull -e "python ../dummyssh" ssh://user@dummy/remote 2>&1 cd .. cd test-2 hg pull -e "python ../dummyssh" -r 5 ssh://user@dummy/remote 2>&1 hg verify hg pull -e "python ../dummyssh" ssh://user@dummy/remote 2>&1 hg verify cd ..