tests/test-hgwebdirsym
author Bernhard Leiner <bleiner@gmail.com>
Sat, 02 Aug 2008 22:10:10 +0200
changeset 6858 8f256bf98219
parent 6341 63bdfcc3eaaf
permissions -rwxr-xr-x
Add support for multiple possible bisect results (issue1228, issue1182) The real reason for both issue is that bisect can not handle cases where there are multiple possibilities for the result. Example (from issue1228): rev 0 -> good rev 1 -> skipped rev 2 -> skipped rev 3 -> skipped rev 4 -> bad Note that this patch does not only fix the reported Assertion Error but also the problem of a non converging bisect: hg init for i in `seq 3`; do echo $i > $i; hg add $i; hg ci -m$i; done hg bisect -b 2 hg bisect -g 0 hg bisect -s From this state on, you can: a) mark as bad forever (non converging!) b) mark as good to get an inconsistent state c) skip for the Assertion Error Minor description and code edits by pmezard.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6341
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     1
#!/bin/sh
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     2
# Tests whether or not hgwebdir properly handles various symlink topologies.
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     3
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     4
"$TESTDIR/hghave" symlink || exit 80
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     5
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     6
hg init a
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     7
echo a > a/a
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     8
hg --cwd a ci -Ama -d'1 0'
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     9
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    10
mkdir webdir
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    11
cd webdir
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    12
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    13
hg init b
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    14
echo b > b/b
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    15
hg --cwd b ci -Amb -d'2 0'
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    16
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    17
hg init c
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    18
echo c > c/c
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    19
hg --cwd c ci -Amc -d'3 0'
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    20
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    21
ln -s ../a al
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    22
ln -s ../webdir circle
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    23
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    24
root=`pwd`
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    25
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    26
cd ..
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    27
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    28
cat > collections.conf <<EOF
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    29
[collections]
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    30
$root=$root
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    31
EOF
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    32
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    33
hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    34
    -A access-collections.log -E error-collections.log
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    35
cat hg.pid >> $DAEMON_PIDS
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    36
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    37
echo % should succeed
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    38
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    39
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/al/file/tip/a?style=raw'
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    40
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw'
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    41
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw'
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    42
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    43
echo % should fail
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    44
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/al/file/tip/a?style=raw'
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    45
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/b/file/tip/a?style=raw'
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    46
"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/c/file/tip/a?style=raw'
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    47
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    48
echo % collections errors
63bdfcc3eaaf test: Add tests for webdir symlinks and walkrepos.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    49
cat error-collections.log