Mercurial > public > mercurial-scm > hg
comparison mercurial/bundle2.py @ 34322:10e162bb9bf5
pull: use 'phase-heads' to retrieve phase information
A new bundle2 capability 'phases' has been added. If 'heads' is part of the
supported value for 'phases', the server supports reading and sending 'phase-
heads' bundle2 part.
Server is now able to process a 'phases' boolean parameter to 'getbundle'. If
'True', a 'phase-heads' bundle2 part will be included in the bundle with phase
information relevant to the whole pulled set. If this method is available the
phases listkey namespace will no longer be listed.
Beside the more efficient encoding of the data, this new method will greatly
improve the phase exchange efficiency for repositories with non-served
changesets (obsolete, secret) since we'll no longer send data about the
filtered heads.
Add a new 'devel.legacy.exchange' config item to allow fallback to the old
'listkey in bundle2' method.
Reminder: the pulled set is not just the changesets bundled by the pull. It
also contains changeset selected by the "pull specification" on the client
side (eg: everything for bare pull). One of the reason why the 'pulled set' is
important is to make sure we can move -common- nodes to public.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Sun, 24 Sep 2017 21:27:18 +0200 |
parents | 4ef472b975ff |
children | 6c7aaf59b21e |
comparison
equal
deleted
inserted
replaced
34321:4ef472b975ff | 34322:10e162bb9bf5 |
---|---|
1393 'listkeys': (), | 1393 'listkeys': (), |
1394 'pushkey': (), | 1394 'pushkey': (), |
1395 'digests': tuple(sorted(util.DIGESTS.keys())), | 1395 'digests': tuple(sorted(util.DIGESTS.keys())), |
1396 'remote-changegroup': ('http', 'https'), | 1396 'remote-changegroup': ('http', 'https'), |
1397 'hgtagsfnodes': (), | 1397 'hgtagsfnodes': (), |
1398 'phases': ('heads',), | |
1398 } | 1399 } |
1399 | 1400 |
1400 def getrepocaps(repo, allowpushback=False): | 1401 def getrepocaps(repo, allowpushback=False): |
1401 """return the bundle2 capabilities for a given repo | 1402 """return the bundle2 capabilities for a given repo |
1402 | 1403 |
1411 if allowpushback: | 1412 if allowpushback: |
1412 caps['pushback'] = () | 1413 caps['pushback'] = () |
1413 cpmode = repo.ui.config('server', 'concurrent-push-mode') | 1414 cpmode = repo.ui.config('server', 'concurrent-push-mode') |
1414 if cpmode == 'check-related': | 1415 if cpmode == 'check-related': |
1415 caps['checkheads'] = ('related',) | 1416 caps['checkheads'] = ('related',) |
1417 if 'phases' in repo.ui.configlist('devel', 'legacy.exchange'): | |
1418 caps.pop('phases') | |
1416 return caps | 1419 return caps |
1417 | 1420 |
1418 def bundle2caps(remote): | 1421 def bundle2caps(remote): |
1419 """return the bundle capabilities of a peer as dict""" | 1422 """return the bundle capabilities of a peer as dict""" |
1420 raw = remote.capable('bundle2') | 1423 raw = remote.capable('bundle2') |