tests/test-url-download.t
changeset 35562 6580cf751418
child 35564 cf841f2b5a72
equal deleted inserted replaced
35561:4c3a4bb31c0e 35562:6580cf751418
       
     1 #require serve
       
     2 
       
     3   $ hg init server
       
     4   $ hg serve -R server -p $HGPORT -d --pid-file=hg1.pid -E ../error.log
       
     5   $ cat hg1.pid >> $DAEMON_PIDS
       
     6 
       
     7 Check basic fetching
       
     8 
       
     9   $ hg debugdownload "http://localhost:$HGPORT/?cmd=lookup&key=tip"
       
    10   1 0000000000000000000000000000000000000000
       
    11   $ hg debugdownload  -o null.txt "http://localhost:$HGPORT/?cmd=lookup&key=null"
       
    12   $ cat null.txt
       
    13   1 0000000000000000000000000000000000000000
       
    14 
       
    15 Check the request is made from the usual Mercurial logic
       
    16 (rev details, give different content if the request has a Mercurial user agent)
       
    17 
       
    18   $ get-with-headers.py --headeronly "localhost:$HGPORT" "rev/tip" content-type
       
    19   200 Script output follows
       
    20   content-type: text/html; charset=ascii
       
    21   $ hg debugdownload "http://localhost:$HGPORT/rev/tip"
       
    22   
       
    23   # HG changeset patch
       
    24   # User 
       
    25   # Date 0 0
       
    26   # Node ID 0000000000000000000000000000000000000000
       
    27   
       
    28   
       
    29   
       
    30   
       
    31 
       
    32 Check other kind of compatible url
       
    33 
       
    34   $ hg debugdownload ./null.txt
       
    35   1 0000000000000000000000000000000000000000
       
    36