tests/test-fetch
changeset 6246 35bf9c23e17a
parent 6235 d16798000be0
child 7007 a6b74fbb5ce0
equal deleted inserted replaced
6245:0d0939b2d272 6246:35bf9c23e17a
     1 #!/bin/sh
     1 #!/bin/sh
       
     2 
       
     3 # adjust to non-default HGPORT, e.g. with run-tests.py -j
       
     4 hideport() { sed "s/localhost:$HGPORT/localhost:20059/"; }
       
     5 hidehash() { sed "s/changeset 3:............ merges/changeset 3:... merges/"; }
     2 
     6 
     3 echo "[extensions]" >> $HGRCPATH
     7 echo "[extensions]" >> $HGRCPATH
     4 echo "fetch=" >> $HGRCPATH
     8 echo "fetch=" >> $HGRCPATH
     5 
     9 
     6 hg init a
    10 hg init a
    34 
    38 
    35 hg --cwd a serve -a localhost -p $HGPORT -d --pid-file=hg.pid
    39 hg --cwd a serve -a localhost -p $HGPORT -d --pid-file=hg.pid
    36 cat a/hg.pid >> "$DAEMON_PIDS"
    40 cat a/hg.pid >> "$DAEMON_PIDS"
    37 
    41 
    38 echo '% fetch over http, no auth'
    42 echo '% fetch over http, no auth'
    39 hg --cwd d fetch -d '5 0' http://localhost:$HGPORT/
    43 hg --cwd d fetch -d '5 0' http://localhost:$HGPORT/ | hideport | hidehash
    40 hg --cwd d tip --template '{desc}\n'
    44 hg --cwd d tip --template '{desc}\n' | hideport
    41 
    45 
    42 echo '% fetch over http with auth (should be hidden in desc)'
    46 echo '% fetch over http with auth (should be hidden in desc)'
    43 hg --cwd e fetch -d '5 0' http://user:password@localhost:$HGPORT/
    47 hg --cwd e fetch -d '5 0' http://user:password@localhost:$HGPORT/ | hideport | hidehash
    44 hg --cwd e tip --template '{desc}\n'
    48 hg --cwd e tip --template '{desc}\n' | hideport
    45 
    49 
    46 hg clone a f
    50 hg clone a f
    47 hg clone a g
    51 hg clone a g
    48 
    52 
    49 echo f > f/f
    53 echo f > f/f