changeset 34365:cd3f39716fd3

exchange: fix test for remote support of binary phases If the remote do not support phases, the "get" call will return None. We change that default return to empty tuple to fix the membership testing. This was a bug in the initial series. Thanks to yuja for catching this.
author Boris Feld <boris.feld@octobus.net>
date Sat, 30 Sep 2017 10:09:29 +0100
parents ff406f3e57b2
children d00910b286cd
files mercurial/exchange.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/exchange.py	Thu Sep 28 15:24:54 2017 +0100
+++ b/mercurial/exchange.py	Sat Sep 30 10:09:29 2017 +0100
@@ -1353,7 +1353,8 @@
 
     ui = pullop.repo.ui
     legacyphase = 'phases' in ui.configlist('devel', 'legacy.exchange')
-    if (not legacyphase and 'heads' in pullop.remotebundle2caps.get('phases')):
+    hasbinaryphase = 'heads' in pullop.remotebundle2caps.get('phases', ())
+    if (not legacyphase and hasbinaryphase):
         kwargs['phases'] = True
         pullop.stepsdone.add('phases')