comparison mercurial/exchange.py @ 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 b5311068077e
children d410336fdb3c
comparison
equal deleted inserted replaced
25478:d19787db6fe0 25479:f00a63a43c4b
953 953
954 If not using bundle2, we have to fetch bookmarks before changeset 954 If not using bundle2, we have to fetch bookmarks before changeset
955 discovery to reduce the chance and impact of race conditions.""" 955 discovery to reduce the chance and impact of race conditions."""
956 if pullop.remotebookmarks is not None: 956 if pullop.remotebookmarks is not None:
957 return 957 return
958 if not _canusebundle2(pullop): # all bundle2 server now support listkeys 958 if (_canusebundle2(pullop)
959 pullop.remotebookmarks = pullop.remote.listkeys('bookmarks') 959 and 'listkeys' in bundle2.bundle2caps(pullop.remote)):
960 # all known bundle2 servers now support listkeys, but lets be nice with
961 # new implementation.
962 return
963 pullop.remotebookmarks = pullop.remote.listkeys('bookmarks')
960 964
961 965
962 @pulldiscovery('changegroup') 966 @pulldiscovery('changegroup')
963 def _pulldiscoverychangegroup(pullop): 967 def _pulldiscoverychangegroup(pullop):
964 """discovery phase for the pull 968 """discovery phase for the pull