tests/test-hgwebdirsym
author Patrick Mezard <pmezard@gmail.com>
Mon, 15 Jun 2009 00:03:26 +0200
changeset 8810 ac92775b3b80
parent 6341 63bdfcc3eaaf
permissions -rwxr-xr-x
Add patch.eol to ignore EOLs when patching (issue1019) The intent is to fix many issues involving patching when win32ext is enabled. With win32ext, the working directory and repository files EOLs are not the same which means that patches made on a non-win32ext host do not apply cleanly because of EOLs discrepancies. A theorically correct approach would be transform either the patched file or the patch content with the encoding/decoding filters used by win32ext. This solution is tricky to implement and invasive, instead we prefer to address the win32ext case, by offering a way to ignore input EOLs when patching and rewriting them when saving the patched result.
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