hgext3rd/topic/discovery.py
changeset 5180 515d425c0a05
parent 5041 71cccd216b01
child 5189 26b47a967a1d
--- a/hgext3rd/topic/discovery.py	Tue Mar 10 11:06:37 2020 +0100
+++ b/hgext3rd/topic/discovery.py	Tue Mar 10 11:07:06 2020 +0100
@@ -17,12 +17,7 @@
     compat,
 )
 
-# hg <= 4.5 (b4d85bc122bd)
-try:
-    from mercurial import wireproto  # pytype: disable=import-error
-    wireproto.branchmap
-except (AttributeError, ImportError):
-    from mercurial import wireprotov1server as wireproto
+from mercurial import wireprotov1server
 
 def _headssummary(orig, pushop, *args, **kwargs):
     # In mercurial > 4.3, we receive the pushop as arguments
@@ -207,8 +202,8 @@
 def modsetup(ui):
     """run at uisetup time to install all destinations wrapping"""
     extensions.wrapfunction(discovery, '_headssummary', _headssummary)
-    extensions.wrapfunction(wireproto, 'branchmap', wireprotobranchmap)
-    extensions.wrapfunction(wireproto, '_capabilities', wireprotocaps)
+    extensions.wrapfunction(wireprotov1server, 'branchmap', wireprotobranchmap)
+    extensions.wrapfunction(wireprotov1server, '_capabilities', wireprotocaps)
     # we need a proper wrap b2 part stuff
     extensions.wrapfunction(bundle2, 'handlecheckheads', handlecheckheads)
     bundle2.handlecheckheads.params = frozenset()