# HG changeset patch # User Pierre-Yves David # Date 2015-06-08 20:32:38 # Node ID f00a63a43c4bb6828c414fc3b327e4ace87a674f # Parent d19787db6fe024de12560d4431a2728a2f474946 bundle2: pull bookmark the old way if no bundle2 listkeys support (issue4701) All known server implementations have listkeys support with bundle2, but people in the process of implementing new servers may not. Let's be nice with them. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -955,8 +955,12 @@ def _pullbookmarkbundle1(pullop): discovery to reduce the chance and impact of race conditions.""" if pullop.remotebookmarks is not None: return - if not _canusebundle2(pullop): # all bundle2 server now support listkeys - pullop.remotebookmarks = pullop.remote.listkeys('bookmarks') + if (_canusebundle2(pullop) + and 'listkeys' in bundle2.bundle2caps(pullop.remote)): + # all known bundle2 servers now support listkeys, but lets be nice with + # new implementation. + return + pullop.remotebookmarks = pullop.remote.listkeys('bookmarks') @pulldiscovery('changegroup')