tests/test-clone-uncompressed.t
changeset 35789 8ed5f7609728
parent 35788 b116a66bcc44
child 35790 c1b9eb15a51c
equal deleted inserted replaced
35788:b116a66bcc44 35789:8ed5f7609728
    19   >>> for i in range(1024):
    19   >>> for i in range(1024):
    20   ...     with open(str(i), 'wb') as fh:
    20   ...     with open(str(i), 'wb') as fh:
    21   ...         fh.write(str(i))
    21   ...         fh.write(str(i))
    22   $ hg -q commit -A -m 'add a lot of files'
    22   $ hg -q commit -A -m 'add a lot of files'
    23   $ hg st
    23   $ hg st
       
    24   $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
       
    25   $ cat hg.pid > $DAEMON_PIDS
       
    26   $ cd ..
       
    27 
       
    28 Cannot stream clone when server.uncompressed is set
       
    29 
       
    30   $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
       
    31   200 Script output follows
       
    32   
       
    33   1
       
    34 
       
    35 #if stream-legacy
       
    36   $ hg debugcapabilities http://localhost:$HGPORT
       
    37   Main capabilities:
       
    38     batch
       
    39     branchmap
       
    40     $USUAL_BUNDLE2_CAPS$
       
    41     changegroupsubset
       
    42     compression=zstd,zlib
       
    43     getbundle
       
    44     httpheader=1024
       
    45     httpmediatype=0.1rx,0.1tx,0.2tx
       
    46     known
       
    47     lookup
       
    48     pushkey
       
    49     unbundle=HG10GZ,HG10BZ,HG10UN
       
    50     unbundlehash
       
    51   Bundle2 capabilities:
       
    52     HG20
       
    53     bookmarks
       
    54     changegroup
       
    55       01
       
    56       02
       
    57     digests
       
    58       md5
       
    59       sha1
       
    60       sha512
       
    61     error
       
    62       abort
       
    63       unsupportedcontent
       
    64       pushraced
       
    65       pushkey
       
    66     hgtagsfnodes
       
    67     listkeys
       
    68     phases
       
    69       heads
       
    70     pushkey
       
    71     remote-changegroup
       
    72       http
       
    73       https
       
    74 
       
    75   $ hg clone --stream -U http://localhost:$HGPORT server-disabled
       
    76   warning: stream clone requested but server has them disabled
       
    77   requesting all changes
       
    78   adding changesets
       
    79   adding manifests
       
    80   adding file changes
       
    81   added 2 changesets with 1025 changes to 1025 files
       
    82   new changesets 96ee1d7354c4:c17445101a72
       
    83 
       
    84   $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
       
    85   200 Script output follows
       
    86   content-type: application/mercurial-0.2
       
    87   
       
    88 
       
    89   $ f --size body --hexdump --bytes 100
       
    90   body: size=112318
       
    91   0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
       
    92   0010: 68 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |h.STREAM2.......|
       
    93   0020: 05 09 04 0c 2d 62 79 74 65 63 6f 75 6e 74 39 38 |....-bytecount98|
       
    94   0030: 37 35 38 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |758filecount1030|
       
    95   0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote|
       
    96   0050: 6e 63 6f 64 65 20 66 6e 63 61 63 68 65 20 67 65 |ncode fncache ge|
       
    97   0060: 6e 65 72 61                                     |nera|
       
    98 
       
    99 #endif
       
   100 #if stream-bundle2
       
   101   $ hg debugcapabilities http://localhost:$HGPORT
       
   102   Main capabilities:
       
   103     batch
       
   104     branchmap
       
   105     $USUAL_BUNDLE2_CAPS$%0Astream%3Dv2
       
   106     changegroupsubset
       
   107     compression=zstd,zlib
       
   108     getbundle
       
   109     httpheader=1024
       
   110     httpmediatype=0.1rx,0.1tx,0.2tx
       
   111     known
       
   112     lookup
       
   113     pushkey
       
   114     unbundle=HG10GZ,HG10BZ,HG10UN
       
   115     unbundlehash
       
   116   Bundle2 capabilities:
       
   117     HG20
       
   118     bookmarks
       
   119     changegroup
       
   120       01
       
   121       02
       
   122     digests
       
   123       md5
       
   124       sha1
       
   125       sha512
       
   126     error
       
   127       abort
       
   128       unsupportedcontent
       
   129       pushraced
       
   130       pushkey
       
   131     hgtagsfnodes
       
   132     listkeys
       
   133     phases
       
   134       heads
       
   135     pushkey
       
   136     remote-changegroup
       
   137       http
       
   138       https
       
   139     stream
       
   140       v2
       
   141 
       
   142   $ hg clone --stream -U http://localhost:$HGPORT server-disabled
       
   143   warning: stream clone requested but server has them disabled
       
   144   requesting all changes
       
   145   adding changesets
       
   146   adding manifests
       
   147   adding file changes
       
   148   added 2 changesets with 1025 changes to 1025 files
       
   149   new changesets 96ee1d7354c4:c17445101a72
       
   150 
       
   151   $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
       
   152   200 Script output follows
       
   153   content-type: application/mercurial-0.2
       
   154   
       
   155 
       
   156   $ f --size body --hexdump --bytes 100
       
   157   body: size=112318
       
   158   0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
       
   159   0010: 68 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |h.STREAM2.......|
       
   160   0020: 05 09 04 0c 2d 62 79 74 65 63 6f 75 6e 74 39 38 |....-bytecount98|
       
   161   0030: 37 35 38 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |758filecount1030|
       
   162   0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote|
       
   163   0050: 6e 63 6f 64 65 20 66 6e 63 61 63 68 65 20 67 65 |ncode fncache ge|
       
   164   0060: 6e 65 72 61                                     |nera|
       
   165 
       
   166 #endif
       
   167 
       
   168   $ killdaemons.py
       
   169   $ cd server
    24   $ hg serve -p $HGPORT -d --pid-file=hg.pid
   170   $ hg serve -p $HGPORT -d --pid-file=hg.pid
    25   $ cat hg.pid >> $DAEMON_PIDS
   171   $ cat hg.pid > $DAEMON_PIDS
    26   $ cd ..
   172   $ cd ..
    27 
   173 
    28 Basic clone
   174 Basic clone
    29 
   175 
    30 #if stream-legacy
   176 #if stream-legacy
   330   > [phases]
   476   > [phases]
   331   > publish = False
   477   > publish = False
   332   > EOF
   478   > EOF
   333   $ killdaemons.py
   479   $ killdaemons.py
   334   $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
   480   $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
   335   $ cat hg.pid >> $DAEMON_PIDS
   481   $ cat hg.pid > $DAEMON_PIDS
   336 
   482 
   337 #if stream-legacy
   483 #if stream-legacy
   338   $ hg clone --stream http://localhost:$HGPORT phase-no-publish
   484   $ hg clone --stream http://localhost:$HGPORT phase-no-publish
   339   streaming all changes
   485   streaming all changes
   340   1027 files to transfer, 96.3 KB of data
   486   1027 files to transfer, 96.3 KB of data