changeset 25479:f00a63a43c4b

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 08 Jun 2015 13:32:38 -0700
parents d19787db6fe0
children d410336fdb3c
files mercurial/exchange.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/exchange.py	Mon Jun 08 15:10:15 2015 -0500
+++ b/mercurial/exchange.py	Mon Jun 08 13:32:38 2015 -0700
@@ -955,8 +955,12 @@
     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')