mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
incoming: request a bundle2 when possible (BC)
Incoming was using bundle1 in all cases, as bundle1 is restricted to changegroup1 and does not support general delta, this can lead to significant CPU overhead if the server is using general delta storage. We now properly request and store a bundle2 to disk. If the server include any output or error in the bundle, they will be stored on disk and replayed when the bundle is read. As 'hg incoming' is going to read the bundle right away, we call that 'good' enough and go back to the bigger plan of having general delta on by default. This was tracked as 4864
This commit is contained in:
parent
1bff95dea7
commit
3ff87b1cf4
@ -455,7 +455,19 @@ def getremotechanges(ui, repo, other, onlyheads=None, bundlename=None,
|
||||
if bundlename or not localrepo:
|
||||
# create a bundle (uncompressed if other repo is not local)
|
||||
|
||||
if True:
|
||||
canbundle2 = (ui.configbool('experimental', 'bundle2-exp', True)
|
||||
and other.capable('getbundle')
|
||||
and other.capable('bundle2'))
|
||||
if canbundle2:
|
||||
kwargs = {}
|
||||
kwargs['common'] = common
|
||||
kwargs['heads'] = rheads
|
||||
kwargs['bundlecaps'] = exchange.caps20to10(repo)
|
||||
kwargs['cg'] = True
|
||||
b2 = other.getbundle('incoming', **kwargs)
|
||||
fname = bundle = changegroup.writechunks(ui, b2._forwardchunks(),
|
||||
bundlename)
|
||||
else:
|
||||
if other.capable('getbundle'):
|
||||
cg = other.getbundle('incoming', common=common, heads=rheads)
|
||||
elif onlyheads is None and not other.capable('changegroupsubset'):
|
||||
|
@ -350,7 +350,7 @@ Test actual protocol when pulling one new head in addition to common heads
|
||||
$ cut -d' ' -f6- access.log | grep -v cmd=known # cmd=known uses random sampling
|
||||
"GET /?cmd=capabilities HTTP/1.1" 200 -
|
||||
"GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D513314ca8b3ae4dac8eec56966265b00fcf866db
|
||||
"GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=513314ca8b3ae4dac8eec56966265b00fcf866db&heads=e64a39e7da8b0d54bc63e81169aff001c13b3477
|
||||
"GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=513314ca8b3ae4dac8eec56966265b00fcf866db&heads=e64a39e7da8b0d54bc63e81169aff001c13b3477
|
||||
"GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases
|
||||
$ cat errors.log
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user