# HG changeset patch # User Pierre-Yves David # Date 2015-06-02 05:29:49 # Node ID 1d1fd5d44f57ca356a66665b74b6ffe2ff7ff71c # Parent 443d3decbdde282d590073426053c00acec884ec pull: skip pulling remote bookmarks with bundle2 if a value already exists For efficiency and consistency purpose, remote bookmarks, retrieved at the time the pull command code is doing lookup, will be reused during the core pull operation. A second step toward this is to avoid requesting bookmark information in the bundle 2 if we already have them locally. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1006,7 +1006,11 @@ def _pullbundle2(pullop): kwargs['heads'] = pullop.heads or pullop.rheads kwargs['cg'] = pullop.fetch if 'listkeys' in remotecaps: - kwargs['listkeys'] = ['phase', 'bookmarks'] + kwargs['listkeys'] = ['phase'] + if pullop.remotebookmarks is None: + # make sure to always includes bookmark data when migrating + # `hg incoming --bundle` to using this function. + kwargs['listkeys'].append('bookmarks') if not pullop.fetch: pullop.repo.ui.status(_("no changes found\n")) pullop.cgresult = 0 @@ -1038,7 +1042,10 @@ def _pullbundle2(pullop): for namespace, value in op.records['listkeys']: if namespace == 'bookmarks': pullop.remotebookmarks = value - _pullbookmarks(pullop) + + # bookmark data were either already there or pulled in the bundle + if pullop.remotebookmarks is not None: + _pullbookmarks(pullop) def _pullbundle2extraprepare(pullop, kwargs): """hook function so that extensions can extend the getbundle call"""