[PATCH phase] exchange: fix test for remote support of binary phases

Boris Feld boris.feld at octobus.net
Sat Sep 30 09:35:09 UTC 2017


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1506762569 -3600
#      Sat Sep 30 10:09:29 2017 +0100
# Node ID 4d26dbcdfdb38fd3fc4efa157b64819f5281c8e0
# Parent  ec769bba34d377503f42308dea5ddcb8ce4c0ade
# EXP-Topic fix-phases
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.

diff -r ec769bba34d3 -r 4d26dbcdfdb3 mercurial/exchange.py
--- a/mercurial/exchange.py	Tue Sep 26 03:56:20 2017 -0700
+++ 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')
 


More information about the Mercurial-devel mailing list