# HG changeset patch # User Pierre-Yves David # Date 1401230686 25200 # Node ID 0696ca0a685b7f5e1490d5835e13d1834b1c2a44 # Parent 0ff44e06275da28a804e9a2e34e7d7e65ca32fea pull: when remote supports it, pull phase data alongside changesets We use bundle2 to retrieve the remote phase data at the same time as changesets. This reduces the amount of requestis and should improve consistency as the server can ensure nothing changed between the retrieval of those parts. diff -r 0ff44e06275d -r 0696ca0a685b mercurial/exchange.py --- a/mercurial/exchange.py Tue May 27 15:43:09 2014 -0700 +++ b/mercurial/exchange.py Tue May 27 15:44:46 2014 -0700 @@ -532,12 +532,15 @@ """pull data using bundle2 For now, the only supported data are changegroup.""" + remotecaps = bundle2.bundle2caps(pullop.remote) kwargs = {'bundlecaps': caps20to10(pullop.repo)} # pulling changegroup pullop.todosteps.remove('changegroup') kwargs['common'] = pullop.common kwargs['heads'] = pullop.heads or pullop.rheads + if 'b2x:listkeys' in remotecaps: + kwargs['listkeys'] = ['phase'] if not pullop.fetch: pullop.repo.ui.status(_("no changes found\n")) pullop.cgresult = 0 @@ -557,6 +560,11 @@ assert len(op.records['changegroup']) == 1 pullop.cgresult = op.records['changegroup'][0]['return'] + # processing phases change + for namespace, value in op.records['listkeys']: + if namespace == 'phases': + _pullapplyphases(pullop, value) + def _pullbundle2extraprepare(pullop, kwargs): """hook function so that extensions can extend the getbundle call""" pass