Mercurial > hg
comparison mercurial/bundle2.py @ 35763:7eedbd5d4880
streamclone: add support for bundle2 based stream clone
The feature put to use the various bits introduced previously. If the server
supports it, the client will request its stream clone through bundle2 instead of
the legacy 'stream_out' commands. The bundle2 version use the better 'v2'
version of stream bundles.
The 'v2' format is not finalized yet. Now that there are some code running it,
we can start working on it again.
Performance numbers are available at the end of this series.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 17 Jan 2018 16:41:44 +0100 |
parents | b996ddf5963d |
children | c97639ad6874 |
comparison
equal
deleted
inserted
replaced
35762:40df727b6f4f | 35763:7eedbd5d4880 |
---|---|
1485 'pushkey': (), | 1485 'pushkey': (), |
1486 'digests': tuple(sorted(util.DIGESTS.keys())), | 1486 'digests': tuple(sorted(util.DIGESTS.keys())), |
1487 'remote-changegroup': ('http', 'https'), | 1487 'remote-changegroup': ('http', 'https'), |
1488 'hgtagsfnodes': (), | 1488 'hgtagsfnodes': (), |
1489 'phases': ('heads',), | 1489 'phases': ('heads',), |
1490 'stream': ('v2',), | |
1490 } | 1491 } |
1491 | 1492 |
1492 def getrepocaps(repo, allowpushback=False): | 1493 def getrepocaps(repo, allowpushback=False): |
1493 """return the bundle2 capabilities for a given repo | 1494 """return the bundle2 capabilities for a given repo |
1494 | 1495 |
1505 cpmode = repo.ui.config('server', 'concurrent-push-mode') | 1506 cpmode = repo.ui.config('server', 'concurrent-push-mode') |
1506 if cpmode == 'check-related': | 1507 if cpmode == 'check-related': |
1507 caps['checkheads'] = ('related',) | 1508 caps['checkheads'] = ('related',) |
1508 if 'phases' in repo.ui.configlist('devel', 'legacy.exchange'): | 1509 if 'phases' in repo.ui.configlist('devel', 'legacy.exchange'): |
1509 caps.pop('phases') | 1510 caps.pop('phases') |
1511 if not repo.ui.configbool('experimental', 'bundle2.stream'): | |
1512 caps.pop('stream') | |
1510 return caps | 1513 return caps |
1511 | 1514 |
1512 def bundle2caps(remote): | 1515 def bundle2caps(remote): |
1513 """return the bundle capabilities of a peer as dict""" | 1516 """return the bundle capabilities of a peer as dict""" |
1514 raw = remote.capable('bundle2') | 1517 raw = remote.capable('bundle2') |