tests/test-http
branchstable
changeset 12795 3cb0559e44d0
parent 12793 469850088fc1
parent 12794 6bf8d48bec8e
child 12796 bc69ba99e34b
equal deleted inserted replaced
12793:469850088fc1 12795:3cb0559e44d0
     1 #!/bin/sh
       
     2 
       
     3 cp "$TESTDIR"/printenv.py .
       
     4 
       
     5 hg init test
       
     6 cd test
       
     7 echo foo>foo
       
     8 mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
       
     9 echo foo>foo.d/foo
       
    10 echo bar>foo.d/bAr.hg.d/BaR
       
    11 echo bar>foo.d/baR.d.hg/bAR
       
    12 
       
    13 hg commit -A -m 1
       
    14 hg serve -p $HGPORT -d --pid-file=../hg1.pid
       
    15 hg --config server.uncompressed=False serve -p $HGPORT1 -d --pid-file=../hg2.pid
       
    16 # Test server address cannot be reused
       
    17 hg serve -p $HGPORT1 2>&1 | sed -e "s/abort: cannot start server at ':$HGPORT1':.*/abort: cannot start server at ':\$HGPORT1':/"
       
    18 cd ..
       
    19 cat hg1.pid hg2.pid >> $DAEMON_PIDS
       
    20 
       
    21 echo % clone via stream
       
    22 hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 | \
       
    23   sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/'
       
    24 hg verify -R copy
       
    25 
       
    26 echo % try to clone via stream, should use pull instead
       
    27 hg clone --uncompressed http://localhost:$HGPORT1/ copy2
       
    28 
       
    29 echo % clone via pull
       
    30 hg clone http://localhost:$HGPORT1/ copy-pull
       
    31 hg verify -R copy-pull
       
    32 
       
    33 cd test
       
    34 echo bar > bar
       
    35 hg commit -A -d '1 0' -m 2
       
    36 cd ..
       
    37 
       
    38 echo % pull
       
    39 cd copy-pull
       
    40 echo '[hooks]' >> .hg/hgrc
       
    41 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
       
    42 hg pull | sed -e "s,:$HGPORT1/,:\$HGPORT1/,"
       
    43 cd ..