tests/test-hgwebdir
changeset 7535 9a962209dc28
parent 7523 e60aaae83323
child 8217 d895158fe8af
equal deleted inserted replaced
7534:5aca12729a0d 7535:9a962209dc28
     6 cd webdir
     6 cd webdir
     7 
     7 
     8 hg init a
     8 hg init a
     9 echo a > a/a
     9 echo a > a/a
    10 hg --cwd a ci -Ama -d'1 0'
    10 hg --cwd a ci -Ama -d'1 0'
       
    11 # create a mercurial queue repository
       
    12 hg --cwd a qinit --config extensions.hgext.mq= -c
    11 
    13 
    12 hg init b
    14 hg init b
    13 echo b > b/b
    15 echo b > b/b
    14 hg --cwd b ci -Amb -d'2 0'
    16 hg --cwd b ci -Amb -d'2 0'
    15 
    17 
       
    18 # create a nested repository
       
    19 cd b
       
    20 hg init d
       
    21 echo d > d/d
       
    22 hg --cwd d ci -Amd -d'3 0'
       
    23 cd ..
       
    24 
    16 hg init c
    25 hg init c
    17 echo c > c/c
    26 echo c > c/c
    18 hg --cwd c ci -Amc -d'3 0'
    27 hg --cwd c ci -Amc -d'3 0'
       
    28 
    19 root=`pwd`
    29 root=`pwd`
    20 
       
    21 cd ..
    30 cd ..
    22 
    31 
    23 cat > paths.conf <<EOF
    32 cat > paths.conf <<EOF
    24 [paths]
    33 [paths]
    25 a=$root/a
    34 a=$root/a
    44 cat > paths.conf <<EOF
    53 cat > paths.conf <<EOF
    45 [paths]
    54 [paths]
    46 t/a/=$root/a
    55 t/a/=$root/a
    47 b=$root/b
    56 b=$root/b
    48 coll=$root/*
    57 coll=$root/*
       
    58 rcoll=$root/**
    49 EOF
    59 EOF
    50 
    60 
    51 hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
    61 hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
    52     -A access-paths.log -E error-paths-2.log
    62     -A access-paths.log -E error-paths-2.log
    53 cat hg.pid >> $DAEMON_PIDS
    63 cat hg.pid >> $DAEMON_PIDS
    62 	| sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//"
    72 	| sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//"
    63 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/file/tip/a?style=raw'
    73 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/file/tip/a?style=raw'
    64 # Test [paths] '*' extension
    74 # Test [paths] '*' extension
    65 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw'
    75 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw'
    66 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw'
    76 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw'
       
    77 #test [paths] '**' extension
       
    78 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw'
       
    79 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw'
       
    80 
    67 
    81 
    68 cat > collections.conf <<EOF
    82 cat > collections.conf <<EOF
    69 [collections]
    83 [collections]
    70 $root=$root
    84 $root=$root
    71 EOF
    85 EOF
    72 
    86 
    73 hg serve -p $HGPORT2 -d --pid-file=hg.pid --webdir-conf collections.conf \
    87 hg serve -p $HGPORT2 -d --pid-file=hg.pid --webdir-conf collections.conf \
    74     -A access-collections.log -E error-collections.log
    88     -A access-collections.log -E error-collections.log
    75 cat hg.pid >> $DAEMON_PIDS
    89 cat hg.pid >> $DAEMON_PIDS
    76 
    90 
    77 echo % should succeed
    91 echo % collections: should succeed
    78 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
    92 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
    79 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw'
    93 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw'
    80 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw'
    94 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw'
    81 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw'
    95 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw'
    82 
    96