changeset 2676:10dedac0d82e

topic: also insert the extra head check with using the new head checking This will get the protection in place in all cases.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 28 Jun 2017 17:28:56 +0200
parents 304232cc14b6
children 8cdee1b9ee92
files hgext3rd/topic/discovery.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/discovery.py	Wed Jun 28 17:38:04 2017 +0200
+++ b/hgext3rd/topic/discovery.py	Wed Jun 28 17:28:56 2017 +0200
@@ -9,6 +9,7 @@
     error,
     exchange,
     extensions,
+    util,
     wireproto,
 )
 
@@ -147,9 +148,14 @@
     extensions.wrapfunction(discovery, '_headssummary', _headssummary)
     extensions.wrapfunction(wireproto, 'branchmap', wireprotobranchmap)
     extensions.wrapfunction(wireproto, '_capabilities', wireprotocaps)
+    # we need a proper wrap b2 part stuff
     extensions.wrapfunction(bundle2, 'handlecheckheads', handlecheckheads)
-    # we need a proper wrap b2 part stuff
     bundle2.handlecheckheads.params = frozenset()
     bundle2.parthandlermapping['check:heads'] = bundle2.handlecheckheads
+    if util.safehasattr(bundle2, 'handlecheckupdatedheads'):
+        # we still need a proper wrap b2 part stuff
+        extensions.wrapfunction(bundle2, 'handlecheckupdatedheads', handlecheckheads)
+        bundle2.handlecheckupdatedheads.params = frozenset()
+        bundle2.parthandlermapping['check:updated-heads'] = bundle2.handlecheckupdatedheads
     extensions.wrapfunction(exchange, '_pushb2phases', _pushb2phases)
     exchange.b2partsgenmapping['phase'] = exchange._pushb2phases